1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

fix: should check if email is verified

This commit is contained in:
Carlos Alexandro Becker
2019-03-11 14:52:08 -03:00
parent 056089bbcc
commit b49aeb222b
2 changed files with 6 additions and 6 deletions

View File

@ -202,8 +202,8 @@ func (p *GitHubProvider) hasOrgAndTeam(accessToken string) (bool, error) {
func (p *GitHubProvider) GetEmailAddress(s *SessionState) (string, error) {
var emails []struct {
Email string `json:"email"`
Primary bool `json:"primary"`
Email string `json:"email"`
Verified bool `json:"verified"`
}
// if we require an Org or Team, check that first
@ -248,7 +248,7 @@ func (p *GitHubProvider) GetEmailAddress(s *SessionState) (string, error) {
}
for _, email := range emails {
if email.Primary {
if email.Verified {
return email.Email, nil
}
}