summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth.go4
-rw-r--r--utils.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/auth.go b/auth.go
index 6f8a970..91ede99 100644
--- a/auth.go
+++ b/auth.go
@@ -62,7 +62,7 @@ func generateAuthorizationURL() (string, error) {
* hacky atomics or having a multiple goroutines to handle
* authentication, neither of which are desirable.
*/
- nonce, err := random(tokenLength)
+ nonce, err := randomBytes(tokenLength)
if err != nil {
return "", err
}
@@ -189,7 +189,7 @@ func handleAuth(w http.ResponseWriter, req *http.Request) {
return
}
- cookieValue, err := random(tokenLength)
+ cookieValue, err := randomBytes(tokenLength)
if err != nil {
wstr(w, http.StatusInternalServerError, err.Error())
return
diff --git a/utils.go b/utils.go
index 81d2e17..3b04493 100644
--- a/utils.go
+++ b/utils.go
@@ -51,7 +51,7 @@ func wstr(w http.ResponseWriter, code int, msg string) {
* encoded string. It's divided by three because we're using base64 and it's
* ideal to ensure that the entropy remains consistent throughout the string.
*/
-func random(sz int) (string, error) {
+func randomBytes(sz int) (string, error) {
r := make([]byte, 3*sz)
_, err := rand.Read(r)
if err != nil {