Skip to content

Commit

Permalink
Restyled by fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and jaanisfehling committed Mar 1, 2024
1 parent 230b86b commit 32a27fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Yesod/Auth/OAuth2/GitHub.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -32,15 +32,16 @@ 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
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) <-
Expand Down

0 comments on commit 32a27fe

Please sign in to comment.