mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-01-11 19:58:28 +01:00
Restyled by fourmolu
This commit is contained in:
parent
730909a7cd
commit
a36d17f7a5
@ -14,9 +14,9 @@ module Yesod.Auth.OAuth2.GitHub
|
||||
, oauth2GitHubScopedWidget
|
||||
) where
|
||||
|
||||
import qualified Data.Text as T
|
||||
import Yesod.Auth.OAuth2.Prelude
|
||||
import Yesod.Core (WidgetFor, whamlet)
|
||||
import qualified Data.Text as T
|
||||
|
||||
newtype User = User Int
|
||||
|
||||
@ -32,7 +32,8 @@ defaultScopes = ["user:email"]
|
||||
oauth2GitHub :: YesodAuth m => Text -> Text -> AuthPlugin m
|
||||
oauth2GitHub = oauth2GitHubScoped defaultScopes
|
||||
|
||||
oauth2GitHubWidget :: YesodAuth m => WidgetFor m () -> Text -> Text -> AuthPlugin m
|
||||
oauth2GitHubWidget
|
||||
:: YesodAuth m => WidgetFor m () -> Text -> Text -> AuthPlugin m
|
||||
oauth2GitHubWidget widget = oauth2GitHubScopedWidget widget defaultScopes
|
||||
|
||||
oauth2GitHubScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
|
||||
@ -40,7 +41,7 @@ oauth2GitHubScoped =
|
||||
oauth2GitHubScopedWidget [whamlet|Login via #{pluginName}|]
|
||||
|
||||
oauth2GitHubScopedWidget
|
||||
:: YesodAuth m => WidgetFor m () ->[Text] -> Text -> Text -> AuthPlugin m
|
||||
:: YesodAuth m => WidgetFor m () -> [Text] -> Text -> Text -> AuthPlugin m
|
||||
oauth2GitHubScopedWidget widget scopes clientId clientSecret =
|
||||
authOAuth2Widget widget pluginName oauth2 $ \manager token -> do
|
||||
(User userId, userResponse) <-
|
||||
|
||||
Loading…
Reference in New Issue
Block a user