Skip to content

Commit

Permalink
Add isNewPrimaryUser in GetRedirectionURLContext
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Dec 7, 2023
1 parent 78ad1f2 commit b6b563b
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/build/SuperTokensBranding.js

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

2 changes: 2 additions & 0 deletions lib/build/emailpassword-shared6.js

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

4 changes: 4 additions & 0 deletions lib/build/passwordless-shared3.js

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

1 change: 1 addition & 0 deletions lib/build/recipe/authRecipe/types.d.ts

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

1 change: 1 addition & 0 deletions lib/build/recipe/session/recipe.d.ts

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

1 change: 1 addition & 0 deletions lib/build/session-shared2.js

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

2 changes: 2 additions & 0 deletions lib/build/thirdparty-shared2.js

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

1 change: 1 addition & 0 deletions lib/ts/recipe/authRecipe/authWidgetWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const Redirector = <T, S, R, N extends NormalisedConfig<T | GetRedirectionURLCon
successRedirectContext: {
action: "SUCCESS",
isNewRecipeUser: false,
isNewPrimaryUser: false,
redirectToPath: getRedirectToPathFromURL(),
},
},
Expand Down
1 change: 1 addition & 0 deletions lib/ts/recipe/authRecipe/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type NormalisedConfig<T, Action, R> = NormalisedRecipeModuleConfig<T, Act
export type GetRedirectionURLContext = {
action: "SUCCESS";
isNewRecipeUser: boolean;
isNewPrimaryUser: boolean;
redirectToPath?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function useChildProps(
rid: recipe!.config.recipeId,
successRedirectContext: {
action: "SUCCESS",
isNewPrimaryUser: false,
isNewRecipeUser: false,
redirectToPath: getRedirectToPathFromURL(),
},
Expand All @@ -132,6 +133,7 @@ export function useChildProps(
rid: recipe!.config.recipeId,
successRedirectContext: {
action: "SUCCESS",
isNewPrimaryUser: true,
isNewRecipeUser: true,
redirectToPath: getRedirectToPathFromURL(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const LinkClickedScreen: React.FC<PropType> = (props) => {
rid: props.recipe.config.recipeId,
successRedirectContext: {
action: "SUCCESS",
isNewPrimaryUser: response.createdNewRecipeUser && response.user.loginMethods.length === 1,
isNewRecipeUser: response.createdNewRecipeUser,
redirectToPath: loginAttemptInfo?.redirectToPath,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down
2 changes: 2 additions & 0 deletions lib/ts/recipe/session/recipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default class Session extends RecipeModule<unknown, unknown, unknown, Nor
successRedirectContext: {
action: "SUCCESS";
isNewRecipeUser: boolean;
isNewPrimaryUser: boolean;
redirectToPath?: string;
};
},
Expand Down Expand Up @@ -202,6 +203,7 @@ export default class Session extends RecipeModule<unknown, unknown, unknown, Nor
rid: Session.RECIPE_ID,
successRedirectContext: {
action: "SUCCESS",
isNewPrimaryUser: false,
isNewRecipeUser: false,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const SignInAndUpCallback: React.FC<PropType> = (props) => {
rid: props.recipe.config.recipeId,
successRedirectContext: {
action: "SUCCESS",
isNewPrimaryUser: response.createdNewRecipeUser && response.user.loginMethods.length === 1,
isNewRecipeUser: response.createdNewRecipeUser,
redirectToPath,
},
Expand Down

0 comments on commit b6b563b

Please sign in to comment.