From 5c1e7430d8ca055d047b8d8a6ab669e6ae97f71d Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Sat, 28 Sep 2024 03:47:08 +0200 Subject: [PATCH] feat: clear loginChallenge queryparam on auth page if we couldn't load it --- lib/build/index2.js | 6 +----- .../authRecipe/components/feature/authPage/authPage.tsx | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/build/index2.js b/lib/build/index2.js index b93bb4190..7b20f9885 100644 --- a/lib/build/index2.js +++ b/lib/build/index2.js @@ -1041,11 +1041,7 @@ var AuthPageInner = function (props) { }); }, function () { - return genericComponentOverrideContext.SuperTokens.getInstanceOrThrow().redirectToAuth({ - navigate: props.navigate, - redirectBack: false, - userContext: userContext, - }); + return genericComponentOverrideContext.clearQueryParams(["loginChallenge"]); } ); React.useEffect( diff --git a/lib/ts/recipe/authRecipe/components/feature/authPage/authPage.tsx b/lib/ts/recipe/authRecipe/components/feature/authPage/authPage.tsx index e5aabf21d..3c30fb84b 100644 --- a/lib/ts/recipe/authRecipe/components/feature/authPage/authPage.tsx +++ b/lib/ts/recipe/authRecipe/components/feature/authPage/authPage.tsx @@ -26,6 +26,7 @@ import { TranslationContextProvider } from "../../../../../translation/translati import { defaultTranslationsCommon } from "../../../../../translation/translations"; import { UserContextProvider, useUserContext } from "../../../../../usercontext"; import { + clearQueryParams, getRedirectToPathFromURL, getTenantIdFromQueryParams, mergeObjects, @@ -192,11 +193,7 @@ const AuthPageInner: React.FC = (props) => { } }, () => { - return SuperTokens.getInstanceOrThrow().redirectToAuth({ - navigate: props.navigate, - redirectBack: false, - userContext, - }); + return clearQueryParams(["loginChallenge"]); } );