This commit is contained in:
2026-11-19 13:39:53 +03:00
parent 470d9d6f1e
commit 1d81159dd3
99 changed files with 10577 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
package auth
import (
"crypto/rand"
"encoding/base64"
"fmt"
)
func GenerateSessionToken() (string, error) {
b := make([]byte, 32)
if _, err := rand.Read(b); err != nil {
return "", fmt.Errorf("generate token: %w", err)
}
return base64.RawURLEncoding.EncodeToString(b), nil
}