Merge pull request #428 from vertextau/oauth-fix

Improve randomString function
This commit is contained in:
Nate Smith 2020-02-14 10:20:22 -06:00 committed by GitHub
commit 10ea161f92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@ package auth
import (
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"io"
@ -20,7 +21,7 @@ func randomString(length int) (string, error) {
if err != nil {
return "", err
}
return fmt.Sprintf("%x", b), nil
return hex.EncodeToString(b), nil
}
// OAuthFlow represents the setup for authenticating with GitHub