1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-08 22:46:33 +02:00

fix: check if it is both primary and verified

This commit is contained in:
Carlos Alexandro Becker
2019-03-20 13:52:30 -03:00
parent 95ee4358b2
commit 24f36f27a7
2 changed files with 18 additions and 4 deletions

View File

@ -203,6 +203,7 @@ func (p *GitHubProvider) GetEmailAddress(s *SessionState) (string, error) {
var emails []struct {
Email string `json:"email"`
Primary bool `json:"primary"`
Verified bool `json:"verified"`
}
@ -248,7 +249,7 @@ func (p *GitHubProvider) GetEmailAddress(s *SessionState) (string, error) {
}
for _, email := range emails {
if email.Verified {
if email.Primary && email.Verified {
return email.Email, nil
}
}