Skip to content

Commit

Permalink
Merge pull request cli#428 from vertextau/oauth-fix
Browse files Browse the repository at this point in the history
Improve randomString function
  • Loading branch information
Nate Smith authored Feb 14, 2020
2 parents 96dc437 + 95cbc56 commit 10ea161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion auth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package auth

import (
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"io"
Expand All @@ -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
Expand Down

0 comments on commit 10ea161

Please sign in to comment.