Skip to content

Commit

Permalink
feat: use redirect info if available on mfa success
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Nov 16, 2023
1 parent 69a2110 commit abce472
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
15 changes: 14 additions & 1 deletion lib/build/passwordless-shared3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion lib/ts/recipe/passwordless/components/features/mfa/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,22 @@ export function useChildProps(
return useMemo(() => {
return {
onSuccess: () => {
const redirectToPath = getRedirectToPathFromURL();
const redirectInfo =
redirectToPath === undefined
? undefined
: {
rid: "passwordless",
successRedirectContext: {
action: "SUCCESS",
isNewRecipeUser: false,
user: undefined,
redirectToPath,
},
};

return SessionRecipe.getInstanceOrThrow().validateGlobalClaimsAndHandleSuccessRedirection(
undefined,
redirectInfo,
userContext,
history
);
Expand Down

0 comments on commit abce472

Please sign in to comment.