mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-04-27 05:07:44 +02: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
|
parseJSON _ = mzero
|
||||||
|
|
||||||
oauth2Github :: YesodAuth m
|
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 ID
|
||||||
-> Text -- ^ Client Secret
|
-> Text -- ^ Client Secret
|
||||||
-> [Text] -- ^ List of scopes to request
|
-> [Text] -- ^ List of scopes to request
|
||||||
-> AuthPlugin m
|
-> AuthPlugin m
|
||||||
oauth2Github clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
|
oauth2GithubScoped clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
|
||||||
where
|
where
|
||||||
oauth = OAuth2
|
oauth = OAuth2
|
||||||
{ oauthClientId = encodeUtf8 clientId
|
{ oauthClientId = encodeUtf8 clientId
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user