mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-09-11 11:54:56 +02:00
Restyled by stylish-haskell
This commit is contained in:
parent
23b73d590d
commit
dfded079c4
@ -28,17 +28,13 @@ module Yesod.Auth.OAuth2
|
|||||||
, getUserResponseJSON
|
, getUserResponseJSON
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Error.Util ( note )
|
import Control.Error.Util (note)
|
||||||
import Control.Monad ( (<=<) )
|
import Control.Monad ((<=<))
|
||||||
import Data.Aeson ( FromJSON
|
import Data.Aeson (FromJSON, eitherDecode)
|
||||||
, eitherDecode
|
import Data.ByteString.Lazy (ByteString, fromStrict)
|
||||||
)
|
import Data.Text (Text)
|
||||||
import Data.ByteString.Lazy ( ByteString
|
import Data.Text.Encoding (encodeUtf8)
|
||||||
, fromStrict
|
import Network.HTTP.Conduit (Manager)
|
||||||
)
|
|
||||||
import Data.Text ( Text )
|
|
||||||
import Data.Text.Encoding ( encodeUtf8 )
|
|
||||||
import Network.HTTP.Conduit ( Manager )
|
|
||||||
import Network.OAuth.OAuth2.Compat
|
import Network.OAuth.OAuth2.Compat
|
||||||
import Yesod.Auth
|
import Yesod.Auth
|
||||||
import Yesod.Auth.OAuth2.Dispatch
|
import Yesod.Auth.OAuth2.Dispatch
|
||||||
|
|||||||
@ -15,10 +15,7 @@ module Yesod.Auth.OAuth2.BattleNet
|
|||||||
|
|
||||||
import Yesod.Auth.OAuth2.Prelude
|
import Yesod.Auth.OAuth2.Prelude
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T (pack, toLower)
|
||||||
( pack
|
|
||||||
, toLower
|
|
||||||
)
|
|
||||||
import Yesod.Core.Widget
|
import Yesod.Core.Widget
|
||||||
|
|
||||||
newtype User = User Int
|
newtype User = User Int
|
||||||
|
|||||||
@ -13,20 +13,19 @@ module Yesod.Auth.OAuth2.Dispatch
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.Except
|
import Control.Monad.Except
|
||||||
import Data.Text ( Text )
|
import Data.Text (Text)
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Text.Encoding ( encodeUtf8 )
|
import Data.Text.Encoding (encodeUtf8)
|
||||||
import Network.HTTP.Conduit ( Manager )
|
import Network.HTTP.Conduit (Manager)
|
||||||
import Network.OAuth.OAuth2.Compat
|
import Network.OAuth.OAuth2.Compat
|
||||||
import Network.OAuth.OAuth2.TokenRequest
|
import Network.OAuth.OAuth2.TokenRequest (Errors)
|
||||||
( Errors )
|
|
||||||
import URI.ByteString.Extension
|
import URI.ByteString.Extension
|
||||||
import UnliftIO.Exception
|
import UnliftIO.Exception
|
||||||
import Yesod.Auth hiding ( ServerError )
|
import Yesod.Auth hiding (ServerError)
|
||||||
import Yesod.Auth.OAuth2.DispatchError
|
import Yesod.Auth.OAuth2.DispatchError
|
||||||
import Yesod.Auth.OAuth2.ErrorResponse
|
import Yesod.Auth.OAuth2.ErrorResponse
|
||||||
import Yesod.Auth.OAuth2.Random
|
import Yesod.Auth.OAuth2.Random
|
||||||
import Yesod.Core hiding ( ErrorResponse )
|
import Yesod.Core hiding (ErrorResponse)
|
||||||
|
|
||||||
-- | How to fetch an @'OAuth2Token'@
|
-- | How to fetch an @'OAuth2Token'@
|
||||||
--
|
--
|
||||||
|
|||||||
@ -32,9 +32,7 @@ module Yesod.Auth.OAuth2.Google
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Yesod.Auth.OAuth2.Prelude
|
import Yesod.Auth.OAuth2.Prelude
|
||||||
import Yesod.Core ( WidgetFor
|
import Yesod.Core (WidgetFor, whamlet)
|
||||||
, whamlet
|
|
||||||
)
|
|
||||||
|
|
||||||
newtype User = User Text
|
newtype User = User Text
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ module Yesod.Auth.OAuth2.Nylas
|
|||||||
|
|
||||||
import Yesod.Auth.OAuth2.Prelude
|
import Yesod.Auth.OAuth2.Prelude
|
||||||
|
|
||||||
import Control.Monad ( unless )
|
import Control.Monad (unless)
|
||||||
import qualified Data.ByteString.Lazy.Char8 as BL8
|
import qualified Data.ByteString.Lazy.Char8 as BL8
|
||||||
import Network.HTTP.Client
|
import Network.HTTP.Client
|
||||||
import qualified Network.HTTP.Types as HT
|
import qualified Network.HTTP.Types as HT
|
||||||
|
|||||||
@ -58,9 +58,9 @@ module Yesod.Auth.OAuth2.Prelude
|
|||||||
|
|
||||||
import Control.Exception.Safe
|
import Control.Exception.Safe
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.ByteString ( ByteString )
|
import Data.ByteString (ByteString)
|
||||||
import qualified Data.ByteString.Lazy as BL
|
import qualified Data.ByteString.Lazy as BL
|
||||||
import Data.Text ( Text )
|
import Data.Text (Text)
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Text.Encoding
|
import Data.Text.Encoding
|
||||||
import Network.HTTP.Conduit
|
import Network.HTTP.Conduit
|
||||||
|
|||||||
@ -13,11 +13,8 @@ module Yesod.Auth.OAuth2.Slack
|
|||||||
|
|
||||||
import Yesod.Auth.OAuth2.Prelude
|
import Yesod.Auth.OAuth2.Prelude
|
||||||
|
|
||||||
import Network.HTTP.Client ( httpLbs
|
import Network.HTTP.Client
|
||||||
, parseUrlThrow
|
(httpLbs, parseUrlThrow, responseBody, setQueryString)
|
||||||
, responseBody
|
|
||||||
, setQueryString
|
|
||||||
)
|
|
||||||
import Yesod.Auth.OAuth2.Exception as YesodOAuth2Exception
|
import Yesod.Auth.OAuth2.Exception as YesodOAuth2Exception
|
||||||
|
|
||||||
data SlackScope
|
data SlackScope
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user