Skip to content

Commit

Permalink
Set "email" scope in facebook auth
Browse files Browse the repository at this point in the history
Fix #31
  • Loading branch information
tylerb committed Mar 26, 2015
1 parent 743e194 commit ac21cb0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions providers/facebook/facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,19 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
AuthURL: authURL,
TokenURL: tokenURL,
},
Scopes: []string{},
Scopes: []string{
"email",
},
}

defaultScopes := map[string]struct{}{
"email": {},
}

for _, scope := range scopes {
c.Scopes = append(c.Scopes, scope)
if _, exists := defaultScopes[scope]; !exists {
c.Scopes = append(c.Scopes, scope)
}
}

return c
Expand Down

0 comments on commit ac21cb0

Please sign in to comment.