diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-28 16:23:19 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-28 16:23:19 -0600 |
| commit | 62fdf88cbdec6dbf248bea13611521667112f5e1 (patch) | |
| tree | 2632236a73a674aa86f8efe46f3553f8d81e5328 /pkg/pls | |
| parent | 3b942be3d49830b80689a5c7b9f0fda4b3deb44b (diff) | |
feat: generate a nonce to validate the OAuth callback
Diffstat (limited to 'pkg/pls')
| -rw-r--r-- | pkg/pls/nonce.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/pls/nonce.go b/pkg/pls/nonce.go new file mode 100644 index 0000000..aeab640 --- /dev/null +++ b/pkg/pls/nonce.go @@ -0,0 +1,11 @@ +package pls + +import ( + "crypto/rand" +) + +func GenerateNonce(size int) string { + nonceBytes := make([]byte, size) + rand.Read(nonceBytes) + return string(nonceBytes) +} |
