mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-04-12 06:09:03 +02:00
change to defaultCallback
This commit is contained in:
parent
3a4e1a6632
commit
d893b687ba
@ -105,7 +105,7 @@ withCallbackAndState
|
|||||||
-> Text
|
-> Text
|
||||||
-> m OAuth2
|
-> m OAuth2
|
||||||
withCallbackAndState name oauth2 csrf = do
|
withCallbackAndState name oauth2 csrf = do
|
||||||
callback <- maybe uriFromPlugin pure $ oauth2RedirectUri oauth2
|
callback <- maybe defaultCallback pure $ oauth2RedirectUri oauth2
|
||||||
pure
|
pure
|
||||||
oauth2
|
oauth2
|
||||||
{ oauth2RedirectUri = Just callback
|
{ oauth2RedirectUri = Just callback
|
||||||
@ -113,7 +113,7 @@ withCallbackAndState name oauth2 csrf = do
|
|||||||
oauth2AuthorizeEndpoint oauth2 `withQuery` [("state", encodeUtf8 csrf)]
|
oauth2AuthorizeEndpoint oauth2 `withQuery` [("state", encodeUtf8 csrf)]
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
uriFromPlugin = do
|
defaultCallback = do
|
||||||
uri <- ($ PluginR name ["callback"]) <$> getParentUrlRender
|
uri <- ($ PluginR name ["callback"]) <$> getParentUrlRender
|
||||||
maybe (throwError $ InvalidCallbackUri uri) pure $ fromText uri
|
maybe (throwError $ InvalidCallbackUri uri) pure $ fromText uri
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user