hardcode the scope to user:email (if more info is needed the code will anyway have to be changed to include more queries)

This commit is contained in:
Freiric Barral 2014-08-31 16:40:02 +02:00
parent a992fdb6fa
commit 8046f4d8cc

View File

@ -56,11 +56,17 @@ instance FromJSON GithubUserEmail where
parseJSON _ = mzero
oauth2Github :: YesodAuth m
=> Text -- ^ Client ID
-> Text -- ^ Client Secret
-> AuthPlugin m
oauth2Github clientId clientSecret = oauth2GithubScoped clientId clientSecret ["user:email"]
oauth2GithubScoped :: YesodAuth m
=> Text -- ^ Client ID
-> Text -- ^ Client Secret
-> [Text] -- ^ List of scopes to request
-> AuthPlugin m
oauth2Github clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
oauth2GithubScoped clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
where
oauth = OAuth2
{ oauthClientId = encodeUtf8 clientId