From d893b687ba4d96d20efd92a5eb7cc12d085ebb42 Mon Sep 17 00:00:00 2001 From: "William R. Arellano" Date: Tue, 31 Oct 2023 11:47:22 -0500 Subject: [PATCH] change to defaultCallback --- src/Yesod/Auth/OAuth2/Dispatch.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yesod/Auth/OAuth2/Dispatch.hs b/src/Yesod/Auth/OAuth2/Dispatch.hs index 6e522f0..434d29e 100644 --- a/src/Yesod/Auth/OAuth2/Dispatch.hs +++ b/src/Yesod/Auth/OAuth2/Dispatch.hs @@ -105,7 +105,7 @@ withCallbackAndState -> Text -> m OAuth2 withCallbackAndState name oauth2 csrf = do - callback <- maybe uriFromPlugin pure $ oauth2RedirectUri oauth2 + callback <- maybe defaultCallback pure $ oauth2RedirectUri oauth2 pure oauth2 { oauth2RedirectUri = Just callback @@ -113,7 +113,7 @@ withCallbackAndState name oauth2 csrf = do oauth2AuthorizeEndpoint oauth2 `withQuery` [("state", encodeUtf8 csrf)] } where - uriFromPlugin = do + defaultCallback = do uri <- ($ PluginR name ["callback"]) <$> getParentUrlRender maybe (throwError $ InvalidCallbackUri uri) pure $ fromText uri