diff --git a/src/Yesod/Auth/OAuth2/AzureAD.hs b/src/Yesod/Auth/OAuth2/AzureAD.hs
index a0168b8..d8d1521 100644
--- a/src/Yesod/Auth/OAuth2/AzureAD.hs
+++ b/src/Yesod/Auth/OAuth2/AzureAD.hs
@@ -9,7 +9,8 @@
module Yesod.Auth.OAuth2.AzureAD
( oauth2AzureAD
, oauth2AzureADScoped
- ) where
+ )
+where
import Prelude
import Yesod.Auth.OAuth2.Prelude
@@ -17,8 +18,7 @@ import Yesod.Auth.OAuth2.Prelude
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "mail"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "mail"
pluginName :: Text
pluginName = "azuread"
@@ -32,8 +32,11 @@ oauth2AzureAD = oauth2AzureADScoped defaultScopes
oauth2AzureADScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
oauth2AzureADScoped scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://graph.microsoft.com/v1.0/me"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://graph.microsoft.com/v1.0/me"
pure Creds
{ credsPlugin = pluginName
@@ -44,10 +47,12 @@ oauth2AzureADScoped scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://login.windows.net/common/oauth2/authorize" `withQuery`
- [ scopeParam "," scopes
- , ("resource", "https://graph.microsoft.com")
- ]
- , oauthAccessTokenEndpoint = "https://login.windows.net/common/oauth2/token"
+ , oauthOAuthorizeEndpoint =
+ "https://login.windows.net/common/oauth2/authorize"
+ `withQuery` [ scopeParam "," scopes
+ , ("resource", "https://graph.microsoft.com")
+ ]
+ , oauthAccessTokenEndpoint =
+ "https://login.windows.net/common/oauth2/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/BattleNet.hs b/src/Yesod/Auth/OAuth2/BattleNet.hs
index 286973b..6b07940 100644
--- a/src/Yesod/Auth/OAuth2/BattleNet.hs
+++ b/src/Yesod/Auth/OAuth2/BattleNet.hs
@@ -11,7 +11,8 @@
module Yesod.Auth.OAuth2.BattleNet
( oauth2BattleNet
, oAuth2BattleNet
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -21,8 +22,7 @@ import Yesod.Core.Widget
newtype User = User Int
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "id"
pluginName :: Text
pluginName = "battle.net"
@@ -38,7 +38,10 @@ oauth2BattleNet widget region clientId clientSecret =
authOAuth2Widget widget pluginName oauth2 $ \manager token -> do
(User userId, userResponse) <-
authGetProfile pluginName manager token
- $ fromRelative "https" (apiHost $ T.toLower region) "/account/user"
+ $ fromRelative
+ "https"
+ (apiHost $ T.toLower region)
+ "/account/user"
pure Creds
{ credsPlugin = pluginName
@@ -64,6 +67,7 @@ wwwHost :: Text -> Host
wwwHost "cn" = "www.battlenet.com.cn"
wwwHost region = Host $ encodeUtf8 $ region <> ".battle.net"
-oAuth2BattleNet :: YesodAuth m => Text -> Text -> Text -> WidgetFor m () -> AuthPlugin m
+oAuth2BattleNet
+ :: YesodAuth m => Text -> Text -> Text -> WidgetFor m () -> AuthPlugin m
oAuth2BattleNet i s r w = oauth2BattleNet w r i s
{-# DEPRECATED oAuth2BattleNet "Use oauth2BattleNet" #-}
diff --git a/src/Yesod/Auth/OAuth2/Bitbucket.hs b/src/Yesod/Auth/OAuth2/Bitbucket.hs
index aff0830..cbc3605 100644
--- a/src/Yesod/Auth/OAuth2/Bitbucket.hs
+++ b/src/Yesod/Auth/OAuth2/Bitbucket.hs
@@ -9,7 +9,8 @@
module Yesod.Auth.OAuth2.Bitbucket
( oauth2Bitbucket
, oauth2BitbucketScoped
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -18,8 +19,7 @@ import qualified Data.Text as T
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "uuid"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "uuid"
pluginName :: Text
pluginName = "bitbucket"
@@ -33,8 +33,11 @@ oauth2Bitbucket = oauth2BitbucketScoped defaultScopes
oauth2BitbucketScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
oauth2BitbucketScoped scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://api.bitbucket.com/2.0/user"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://api.bitbucket.com/2.0/user"
pure Creds
{ credsPlugin = pluginName
@@ -51,9 +54,10 @@ oauth2BitbucketScoped scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://bitbucket.com/site/oauth2/authorize" `withQuery`
- [ scopeParam "," scopes
- ]
- , oauthAccessTokenEndpoint = "https://bitbucket.com/site/oauth2/access_token"
+ , oauthOAuthorizeEndpoint =
+ "https://bitbucket.com/site/oauth2/authorize"
+ `withQuery` [scopeParam "," scopes]
+ , oauthAccessTokenEndpoint =
+ "https://bitbucket.com/site/oauth2/access_token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/EveOnline.hs b/src/Yesod/Auth/OAuth2/EveOnline.hs
index 6477063..6d8765a 100644
--- a/src/Yesod/Auth/OAuth2/EveOnline.hs
+++ b/src/Yesod/Auth/OAuth2/EveOnline.hs
@@ -11,7 +11,8 @@ module Yesod.Auth.OAuth2.EveOnline
( oauth2Eve
, oauth2EveScoped
, WidgetType(..)
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -21,8 +22,7 @@ import Yesod.Core.Widget
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "CharacterOwnerHash"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "CharacterOwnerHash"
data WidgetType m
= Plain -- ^ Simple "Login via eveonline" text
@@ -34,10 +34,14 @@ data WidgetType m
asWidget :: YesodAuth m => WidgetType m -> WidgetFor m ()
asWidget Plain = [whamlet|Login via eveonline|]
-asWidget BigWhite = [whamlet|
|]
-asWidget BigBlack = [whamlet|
|]
-asWidget SmallWhite = [whamlet|
|]
-asWidget SmallBlack = [whamlet|
|]
+asWidget BigWhite =
+ [whamlet|
|]
+asWidget BigBlack
+ = [whamlet|
|]
+asWidget SmallWhite
+ = [whamlet|
|]
+asWidget SmallBlack
+ = [whamlet|
|]
asWidget (Custom a) = a
pluginName :: Text
@@ -49,26 +53,30 @@ defaultScopes = ["publicData"]
oauth2Eve :: YesodAuth m => WidgetType m -> Text -> Text -> AuthPlugin m
oauth2Eve = oauth2EveScoped defaultScopes
-oauth2EveScoped :: YesodAuth m => [Text] -> WidgetType m -> Text -> Text -> AuthPlugin m
+oauth2EveScoped
+ :: YesodAuth m => [Text] -> WidgetType m -> Text -> Text -> AuthPlugin m
oauth2EveScoped scopes widgetType clientId clientSecret =
- authOAuth2Widget (asWidget widgetType) pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://login.eveonline.com/oauth/verify"
+ authOAuth2Widget (asWidget widgetType) pluginName oauth2
+ $ \manager token -> do
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://login.eveonline.com/oauth/verify"
- pure Creds
- { credsPlugin = "eveonline"
- -- FIXME: Preserved bug. See similar comment in Bitbucket provider.
- , credsIdent = T.pack $ show userId
- , credsExtra = setExtra token userResponse
- }
+ pure Creds
+ { credsPlugin = "eveonline"
+ -- FIXME: Preserved bug. See similar comment in Bitbucket provider.
+ , credsIdent = T.pack $ show userId
+ , credsExtra = setExtra token userResponse
+ }
where
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://login.eveonline.com/oauth/authorize" `withQuery`
- [ ("response_type", "code")
- , scopeParam " " scopes
- ]
+ , oauthOAuthorizeEndpoint =
+ "https://login.eveonline.com/oauth/authorize"
+ `withQuery` [("response_type", "code"), scopeParam " " scopes]
, oauthAccessTokenEndpoint = "https://login.eveonline.com/oauth/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/GitHub.hs b/src/Yesod/Auth/OAuth2/GitHub.hs
index c0fca64..f012e85 100644
--- a/src/Yesod/Auth/OAuth2/GitHub.hs
+++ b/src/Yesod/Auth/OAuth2/GitHub.hs
@@ -9,7 +9,8 @@
module Yesod.Auth.OAuth2.GitHub
( oauth2GitHub
, oauth2GitHubScoped
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -18,8 +19,7 @@ import qualified Data.Text as T
newtype User = User Int
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "id"
pluginName :: Text
pluginName = "github"
@@ -33,8 +33,11 @@ oauth2GitHub = oauth2GitHubScoped defaultScopes
oauth2GitHubScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
oauth2GitHubScoped scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://api.github.com/user"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://api.github.com/user"
pure Creds
{ credsPlugin = pluginName
@@ -45,9 +48,10 @@ oauth2GitHubScoped scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://github.com/login/oauth/authorize" `withQuery`
- [ scopeParam "," scopes
- ]
- , oauthAccessTokenEndpoint = "https://github.com/login/oauth/access_token"
+ , oauthOAuthorizeEndpoint =
+ "https://github.com/login/oauth/authorize"
+ `withQuery` [scopeParam "," scopes]
+ , oauthAccessTokenEndpoint =
+ "https://github.com/login/oauth/access_token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/GitLab.hs b/src/Yesod/Auth/OAuth2/GitLab.hs
index 0f07369..0b1eaea 100644
--- a/src/Yesod/Auth/OAuth2/GitLab.hs
+++ b/src/Yesod/Auth/OAuth2/GitLab.hs
@@ -4,7 +4,8 @@ module Yesod.Auth.OAuth2.GitLab
, oauth2GitLabHostScopes
, defaultHost
, defaultScopes
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -13,8 +14,7 @@ import qualified Data.Text as T
newtype User = User Int
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "id"
pluginName :: Text
pluginName = "gitlab"
@@ -37,11 +37,14 @@ defaultScopes = ["read_user"]
oauth2GitLab :: YesodAuth m => Text -> Text -> AuthPlugin m
oauth2GitLab = oauth2GitLabHostScopes defaultHost defaultScopes
-oauth2GitLabHostScopes :: YesodAuth m => URI -> [Text] -> Text -> Text -> AuthPlugin m
+oauth2GitLabHostScopes
+ :: YesodAuth m => URI -> [Text] -> Text -> Text -> AuthPlugin m
oauth2GitLabHostScopes host scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <- authGetProfile pluginName manager token
- $ host `withPath` "/api/v4/user"
+ (User userId, userResponse) <-
+ authGetProfile pluginName manager token
+ $ host
+ `withPath` "/api/v4/user"
pure Creds
{ credsPlugin = pluginName
@@ -52,9 +55,10 @@ oauth2GitLabHostScopes host scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = host
+ , oauthOAuthorizeEndpoint =
+ host
`withPath` "/oauth/authorize"
- `withQuery` [ scopeParam " " scopes ]
+ `withQuery` [scopeParam " " scopes]
, oauthAccessTokenEndpoint = host `withPath` "/oauth/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Google.hs b/src/Yesod/Auth/OAuth2/Google.hs
index b6538cd..68c9368 100644
--- a/src/Yesod/Auth/OAuth2/Google.hs
+++ b/src/Yesod/Auth/OAuth2/Google.hs
@@ -26,16 +26,18 @@
module Yesod.Auth.OAuth2.Google
( oauth2Google
, oauth2GoogleScoped
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
+ parseJSON =
+ withObject "User" $ \o -> User
-- Required for data backwards-compatibility
- <$> (("google-uid:" <>) <$> o .: "sub")
+ <$> (("google-uid:" <>) <$> o .: "sub")
pluginName :: Text
pluginName = "google"
@@ -49,8 +51,11 @@ oauth2Google = oauth2GoogleScoped defaultScopes
oauth2GoogleScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
oauth2GoogleScoped scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://www.googleapis.com/oauth2/v3/userinfo"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://www.googleapis.com/oauth2/v3/userinfo"
pure Creds
{ credsPlugin = pluginName
@@ -61,9 +66,10 @@ oauth2GoogleScoped scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://accounts.google.com/o/oauth2/auth" `withQuery`
- [ scopeParam " " scopes
- ]
- , oauthAccessTokenEndpoint = "https://www.googleapis.com/oauth2/v3/token"
+ , oauthOAuthorizeEndpoint =
+ "https://accounts.google.com/o/oauth2/auth"
+ `withQuery` [scopeParam " " scopes]
+ , oauthAccessTokenEndpoint =
+ "https://www.googleapis.com/oauth2/v3/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Nylas.hs b/src/Yesod/Auth/OAuth2/Nylas.hs
index 25c93a4..5ba08b8 100644
--- a/src/Yesod/Auth/OAuth2/Nylas.hs
+++ b/src/Yesod/Auth/OAuth2/Nylas.hs
@@ -2,7 +2,8 @@
module Yesod.Auth.OAuth2.Nylas
( oauth2Nylas
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -15,8 +16,7 @@ import qualified Yesod.Auth.OAuth2.Exception as YesodOAuth2Exception
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "id"
pluginName :: Text
pluginName = "nylas"
@@ -53,16 +53,17 @@ oauth2Nylas clientId clientSecret =
oauth = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://api.nylas.com/oauth/authorize"
- `withQuery` [ ("response_type", "code")
- , ( "client_id"
- , encodeUtf8 clientId
- )
+ , oauthOAuthorizeEndpoint =
+ "https://api.nylas.com/oauth/authorize"
+ `withQuery` [ ("response_type", "code")
+ , ( "client_id"
+ , encodeUtf8 clientId
+ )
-- N.B. The scopes delimeter is unknown/untested. Verify that before
-- extracting this to an argument and offering a Scoped function. In
-- its current state, it doesn't matter because it's only one scope.
- , scopeParam "," defaultScopes
- ]
+ , scopeParam "," defaultScopes
+ ]
, oauthAccessTokenEndpoint = "https://api.nylas.com/oauth/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Salesforce.hs b/src/Yesod/Auth/OAuth2/Salesforce.hs
index d8f5fa7..d487386 100644
--- a/src/Yesod/Auth/OAuth2/Salesforce.hs
+++ b/src/Yesod/Auth/OAuth2/Salesforce.hs
@@ -11,15 +11,15 @@ module Yesod.Auth.OAuth2.Salesforce
, oauth2SalesforceScoped
, oauth2SalesforceSandbox
, oauth2SalesforceSandboxScoped
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "user_id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "user_id"
pluginName :: Text
pluginName = "salesforce"
@@ -31,7 +31,8 @@ oauth2Salesforce :: YesodAuth m => Text -> Text -> AuthPlugin m
oauth2Salesforce = oauth2SalesforceScoped defaultScopes
oauth2SalesforceScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
-oauth2SalesforceScoped = salesforceHelper pluginName
+oauth2SalesforceScoped = salesforceHelper
+ pluginName
"https://login.salesforce.com/services/oauth2/userinfo"
"https://login.salesforce.com/services/oauth2/authorize"
"https://login.salesforce.com/services/oauth2/token"
@@ -39,8 +40,10 @@ oauth2SalesforceScoped = salesforceHelper pluginName
oauth2SalesforceSandbox :: YesodAuth m => Text -> Text -> AuthPlugin m
oauth2SalesforceSandbox = oauth2SalesforceSandboxScoped defaultScopes
-oauth2SalesforceSandboxScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
-oauth2SalesforceSandboxScoped = salesforceHelper (pluginName <> "-sandbox")
+oauth2SalesforceSandboxScoped
+ :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
+oauth2SalesforceSandboxScoped = salesforceHelper
+ (pluginName <> "-sandbox")
"https://test.salesforce.com/services/oauth2/userinfo"
"https://test.salesforce.com/services/oauth2/authorize"
"https://test.salesforce.com/services/oauth2/token"
@@ -55,9 +58,13 @@ salesforceHelper
-> Text
-> Text
-> AuthPlugin m
-salesforceHelper name profileUri authorizeUri tokenUri scopes clientId clientSecret =
- authOAuth2 name oauth2 $ \manager token -> do
- (User userId, userResponse) <- authGetProfile name manager token profileUri
+salesforceHelper name profileUri authorizeUri tokenUri scopes clientId clientSecret
+ = authOAuth2 name oauth2 $ \manager token -> do
+ (User userId, userResponse) <- authGetProfile
+ name
+ manager
+ token
+ profileUri
pure Creds
{ credsPlugin = pluginName
@@ -68,7 +75,8 @@ salesforceHelper name profileUri authorizeUri tokenUri scopes clientId clientSec
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = authorizeUri `withQuery` [scopeParam " " scopes]
+ , oauthOAuthorizeEndpoint =
+ authorizeUri `withQuery` [scopeParam " " scopes]
, oauthAccessTokenEndpoint = tokenUri
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Slack.hs b/src/Yesod/Auth/OAuth2/Slack.hs
index fc7e8bb..3c539fc 100644
--- a/src/Yesod/Auth/OAuth2/Slack.hs
+++ b/src/Yesod/Auth/OAuth2/Slack.hs
@@ -9,7 +9,8 @@ module Yesod.Auth.OAuth2.Slack
( SlackScope(..)
, oauth2Slack
, oauth2SlackScoped
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -66,8 +67,9 @@ oauth2SlackScoped scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://slack.com/oauth/authorize"
- `withQuery` [scopeParam "," $ map scopeText scopes]
+ , oauthOAuthorizeEndpoint =
+ "https://slack.com/oauth/authorize"
+ `withQuery` [scopeParam "," $ map scopeText scopes]
, oauthAccessTokenEndpoint = "https://slack.com/api/oauth.access"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Spotify.hs b/src/Yesod/Auth/OAuth2/Spotify.hs
index 22d355a..24821a3 100644
--- a/src/Yesod/Auth/OAuth2/Spotify.hs
+++ b/src/Yesod/Auth/OAuth2/Spotify.hs
@@ -5,15 +5,15 @@
--
module Yesod.Auth.OAuth2.Spotify
( oauth2Spotify
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
newtype User = User Text
instance FromJSON User where
- parseJSON = withObject "User" $ \o -> User
- <$> o .: "id"
+ parseJSON = withObject "User" $ \o -> User <$> o .: "id"
pluginName :: Text
pluginName = "spotify"
@@ -21,8 +21,11 @@ pluginName = "spotify"
oauth2Spotify :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m
oauth2Spotify scopes clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "https://api.spotify.com/v1/me"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "https://api.spotify.com/v1/me"
pure Creds
{ credsPlugin = pluginName
@@ -33,9 +36,9 @@ oauth2Spotify scopes clientId clientSecret =
oauth2 = OAuth2
{ oauthClientId = clientId
, oauthClientSecret = clientSecret
- , oauthOAuthorizeEndpoint = "https://accounts.spotify.com/authorize" `withQuery`
- [ scopeParam " " scopes
- ]
+ , oauthOAuthorizeEndpoint =
+ "https://accounts.spotify.com/authorize"
+ `withQuery` [scopeParam " " scopes]
, oauthAccessTokenEndpoint = "https://accounts.spotify.com/api/token"
, oauthCallback = Nothing
}
diff --git a/src/Yesod/Auth/OAuth2/Upcase.hs b/src/Yesod/Auth/OAuth2/Upcase.hs
index a21d8c1..6ae9f9d 100644
--- a/src/Yesod/Auth/OAuth2/Upcase.hs
+++ b/src/Yesod/Auth/OAuth2/Upcase.hs
@@ -8,7 +8,8 @@
--
module Yesod.Auth.OAuth2.Upcase
( oauth2Upcase
- ) where
+ )
+where
import Yesod.Auth.OAuth2.Prelude
@@ -27,8 +28,11 @@ pluginName = "upcase"
oauth2Upcase :: YesodAuth m => Text -> Text -> AuthPlugin m
oauth2Upcase clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do
- (User userId, userResponse) <-
- authGetProfile pluginName manager token "http://upcase.com/api/v1/me.json"
+ (User userId, userResponse) <- authGetProfile
+ pluginName
+ manager
+ token
+ "http://upcase.com/api/v1/me.json"
pure Creds
{ credsPlugin = pluginName