diff --git a/lib/build/SuperTokensBranding.js b/lib/build/SuperTokensBranding.js index a4ef40119..5fbba216d 100644 --- a/lib/build/SuperTokensBranding.js +++ b/lib/build/SuperTokensBranding.js @@ -46,6 +46,7 @@ var Redirector = function (props) { successRedirectContext: { action: "SUCCESS", isNewRecipeUser: false, + isNewPrimaryUser: false, redirectToPath: genericComponentOverrideContext.getRedirectToPathFromURL(), }, }, diff --git a/lib/build/emailpassword-shared6.js b/lib/build/emailpassword-shared6.js index d933bada4..8c8457a03 100644 --- a/lib/build/emailpassword-shared6.js +++ b/lib/build/emailpassword-shared6.js @@ -1187,6 +1187,7 @@ function useChildProps(recipe$1, state, dispatch, navigate) { rid: recipe$1.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: false, isNewRecipeUser: false, redirectToPath: genericComponentOverrideContext.getRedirectToPathFromURL(), }, @@ -1211,6 +1212,7 @@ function useChildProps(recipe$1, state, dispatch, navigate) { rid: recipe$1.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: true, isNewRecipeUser: true, redirectToPath: genericComponentOverrideContext.getRedirectToPathFromURL(), }, diff --git a/lib/build/passwordless-shared3.js b/lib/build/passwordless-shared3.js index a292c5811..3834b0a06 100644 --- a/lib/build/passwordless-shared3.js +++ b/lib/build/passwordless-shared3.js @@ -351,6 +351,9 @@ var LinkClickedScreen = function (props) { rid: props.recipe.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: + response.createdNewRecipeUser && + response.user.loginMethods.length === 1, isNewRecipeUser: response.createdNewRecipeUser, redirectToPath: loginAttemptInfo === null || loginAttemptInfo === void 0 @@ -3961,6 +3964,7 @@ function useChildProps(recipe$1, dispatch, state, userContext, navigate) { rid: recipe$1.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: result.createdNewRecipeUser && result.user.loginMethods.length === 1, isNewRecipeUser: result.createdNewRecipeUser, redirectToPath: genericComponentOverrideContext.getRedirectToPathFromURL(), }, diff --git a/lib/build/recipe/authRecipe/types.d.ts b/lib/build/recipe/authRecipe/types.d.ts index 37b707605..d4296093b 100644 --- a/lib/build/recipe/authRecipe/types.d.ts +++ b/lib/build/recipe/authRecipe/types.d.ts @@ -9,6 +9,7 @@ export declare type NormalisedConfig = NormalisedRecipeModuleConfi export declare type GetRedirectionURLContext = { action: "SUCCESS"; isNewRecipeUser: boolean; + isNewPrimaryUser: boolean; redirectToPath?: string; }; export declare type OnHandleEventContext = { diff --git a/lib/build/recipe/session/recipe.d.ts b/lib/build/recipe/session/recipe.d.ts index 6ab8debef..b4d25bce4 100644 --- a/lib/build/recipe/session/recipe.d.ts +++ b/lib/build/recipe/session/recipe.d.ts @@ -60,6 +60,7 @@ export default class Session extends RecipeModule = NormalisedRecipeModuleConfig = (props) => { rid: props.recipe.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: response.createdNewRecipeUser && response.user.loginMethods.length === 1, isNewRecipeUser: response.createdNewRecipeUser, redirectToPath: loginAttemptInfo?.redirectToPath, }, diff --git a/lib/ts/recipe/passwordless/components/features/signInAndUp/index.tsx b/lib/ts/recipe/passwordless/components/features/signInAndUp/index.tsx index 4f04fd450..6bcc43bf8 100644 --- a/lib/ts/recipe/passwordless/components/features/signInAndUp/index.tsx +++ b/lib/ts/recipe/passwordless/components/features/signInAndUp/index.tsx @@ -175,6 +175,7 @@ export function useChildProps( rid: recipe.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: result.createdNewRecipeUser && result.user.loginMethods.length === 1, isNewRecipeUser: result.createdNewRecipeUser, redirectToPath: getRedirectToPathFromURL(), }, diff --git a/lib/ts/recipe/session/recipe.tsx b/lib/ts/recipe/session/recipe.tsx index 7ed77ef23..5d964f654 100644 --- a/lib/ts/recipe/session/recipe.tsx +++ b/lib/ts/recipe/session/recipe.tsx @@ -143,6 +143,7 @@ export default class Session extends RecipeModule = (props) => { rid: props.recipe.config.recipeId, successRedirectContext: { action: "SUCCESS", + isNewPrimaryUser: response.createdNewRecipeUser && response.user.loginMethods.length === 1, isNewRecipeUser: response.createdNewRecipeUser, redirectToPath, },