uppercase everywhere

This commit is contained in:
Ding 2024-05-24 23:57:38 +08:00
parent 2c892977cc
commit 6c1f627067
2 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ mkFoundation = do
, loadPlugin (oauth2Spotify []) "SPOTIFY" , loadPlugin (oauth2Spotify []) "SPOTIFY"
, loadPlugin oauth2Twitch "TWITCH" , loadPlugin oauth2Twitch "TWITCH"
, loadPlugin oauth2WordPressDotCom "WORDPRESS_DOT_COM" , loadPlugin oauth2WordPressDotCom "WORDPRESS_DOT_COM"
, loadPlugin oauth2Orcid "ORCID" , loadPlugin oauth2ORCID "ORCID"
, loadPlugin oauth2Upcase "UPCASE" , loadPlugin oauth2Upcase "UPCASE"
] ]

View File

@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Yesod.Auth.OAuth2.ORCID module Yesod.Auth.OAuth2.ORCID
( oauth2Orcid ( oauth2ORCID
) where ) where
import qualified Data.Text as T import qualified Data.Text as T
@ -15,14 +15,14 @@ newtype User = User Text
instance FromJSON User where instance FromJSON User where
parseJSON = withObject "User" $ \o -> User <$> o .: "sub" parseJSON = withObject "User" $ \o -> User <$> o .: "sub"
oauth2Orcid oauth2ORCID
:: YesodAuth m :: YesodAuth m
=> Text => Text
-- ^ Client Id -- ^ Client Id
-> Text -> Text
-- ^ Client Secret -- ^ Client Secret
-> AuthPlugin m -> AuthPlugin m
oauth2Orcid clientId clientSecret = oauth2ORCID clientId clientSecret =
authOAuth2 pluginName oauth2 $ \manager token -> do authOAuth2 pluginName oauth2 $ \manager token -> do
(User userId, userResponse) <- (User userId, userResponse) <-
authGetProfile authGetProfile