···66 "encoding/base64"
77)
8899-// this generates pseudo-unique nonces to prevent token (JWT) replay. these do not need to be cryptographically resilient
1010-func randomNonce() string {
1111- buf := make([]byte, 16)
99+// This is used both for PKCE challenges, and for pseudo-unique nonces to prevent token (JWT) replay.
1010+func secureRandomBase64(sizeBytes uint) string {
1111+ buf := make([]byte, sizeBytes)
1212 rand.Read(buf)
1313 return base64.RawURLEncoding.EncodeToString(buf)
1414}