mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-01-11 19:58:28 +01:00
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:
parent
a992fdb6fa
commit
8046f4d8cc
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user