c987e3ec19
new file: internal/utils/oauth_utils.go add utils oauth state generate
14 lines
238 B
Go
14 lines
238 B
Go
// utils/oauth_utils.go
|
|
package utils
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
)
|
|
|
|
// GenerateState generates a random state string for OAuth
|
|
func GenerateState() string {
|
|
b := make([]byte, 16)
|
|
rand.Read(b)
|
|
return fmt.Sprintf("%x", b)
|
|
} |