Skip to content

Commit

Permalink
Fix github auth
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed Dec 31, 2020
1 parent ab36416 commit 2e11dea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion http/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func (s *Server) handleOAuthGitHubCallback(w http.ResponseWriter, r *http.Reques
// Email is not necessarily available for all accounts. If it is, store it
// so we can link together multiple OAuth providers in the future
// (e.g. GitHub, Google, etc).
var name string
if u.Name != nil {
name = *u.Name
} else if u.Login != nil {
name = *u.Login
}
var email string
if u.Email != nil {
email = *u.Email
Expand All @@ -127,7 +133,7 @@ func (s *Server) handleOAuthGitHubCallback(w http.ResponseWriter, r *http.Reques
AccessToken: tok.AccessToken,
RefreshToken: tok.RefreshToken,
User: &wtf.User{
Name: *u.Name,
Name: name,
Email: email,
},
}
Expand Down

0 comments on commit 2e11dea

Please sign in to comment.