From 00ee185b7cd11dcaf75339ab956574a84af26a12 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Fri, 17 Nov 2023 00:01:08 +0100 Subject: [PATCH] refactor: use redirectToFactor instead of re-implementing --- lib/build/multifactorauthprebuiltui.js | 2 +- .../multifactorauth/components/features/factorChooser/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/build/multifactorauthprebuiltui.js b/lib/build/multifactorauthprebuiltui.js index f91cdf660..2da79b44b 100644 --- a/lib/build/multifactorauthprebuiltui.js +++ b/lib/build/multifactorauthprebuiltui.js @@ -409,7 +409,7 @@ var FactorChooser$1 = function (props) { ); var navigateToFactor = React.useCallback( function (factorId) { - return props.recipe.redirect({ action: "GO_TO_FACTOR", factorId: factorId }); + return props.recipe.redirectToFactor(factorId, false, props.history); }, [props.recipe] ); diff --git a/lib/ts/recipe/multifactorauth/components/features/factorChooser/index.tsx b/lib/ts/recipe/multifactorauth/components/features/factorChooser/index.tsx index 0d68173a3..ea2b792a7 100644 --- a/lib/ts/recipe/multifactorauth/components/features/factorChooser/index.tsx +++ b/lib/ts/recipe/multifactorauth/components/features/factorChooser/index.tsx @@ -97,7 +97,7 @@ export const FactorChooser: React.FC = (props) => { useOnMountAPICall(fetchMFAInfo, checkMFAInfo, handleError, sessionContext.loading === false); const navigateToFactor = useCallback( - (factorId) => props.recipe.redirect({ action: "GO_TO_FACTOR", factorId }), + (factorId) => props.recipe.redirectToFactor(factorId, false, props.history), [props.recipe] ); const signOut = useCallback(async (): Promise => {