mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-01-11 19:58:28 +01:00
use alternative in oauth2RedirectUri
This commit is contained in:
parent
79a955edd0
commit
87dc101b47
@ -13,6 +13,7 @@ module Yesod.Auth.OAuth2.Dispatch
|
||||
) where
|
||||
|
||||
import Control.Monad (unless)
|
||||
import Control.Applicative ((<|>))
|
||||
import Control.Monad.Except (MonadError (..))
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
@ -109,7 +110,7 @@ withCallbackAndState name oauth2 csrf = do
|
||||
callback <- maybe (throwError $ InvalidCallbackUri uri) pure $ fromText uri
|
||||
pure
|
||||
oauth2
|
||||
{ oauth2RedirectUri = Just callback
|
||||
{ oauth2RedirectUri = (oauth2RedirectUri oauth2) <|> Just callback
|
||||
, oauth2AuthorizeEndpoint =
|
||||
oauth2AuthorizeEndpoint oauth2 `withQuery` [("state", encodeUtf8 csrf)]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user