Skip to content

Commit

Permalink
fix: update dependency branch names and fix example test issues (#798)
Browse files Browse the repository at this point in the history
* chore: update dependency branch names

* chore: update size limit

* fix: expect successful sign in/ups to not always create a session
  • Loading branch information
porcellus authored Mar 12, 2024
1 parent 4299e90 commit daf1e30
Show file tree
Hide file tree
Showing 11 changed files with 15,274 additions and 64 deletions.
40 changes: 28 additions & 12 deletions lib/build/emailpassword-shared7.js

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

57 changes: 38 additions & 19 deletions lib/build/passwordless-shared3.js

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

29 changes: 20 additions & 9 deletions lib/build/thirdparty-shared2.js

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

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ export function useChildProps(
const rethrowInRender = useRethrowInRender();

const onSignInSuccess = useCallback(async (): Promise<void> => {
const payloadAfterSuccess = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({ userContext });
let payloadAfterCall;
try {
payloadAfterCall = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({
userContext,
});
} catch {
payloadAfterCall = undefined;
}

return Session.getInstanceOrThrow()
.validateGlobalClaimsAndHandleSuccessRedirection(
{
Expand All @@ -131,7 +139,8 @@ export function useChildProps(
newSessionCreated:
session.loading ||
!session.doesSessionExist ||
session.accessTokenPayload.sessionHandle !== payloadAfterSuccess.sessionHandle,
(payloadAfterCall !== undefined &&
session.accessTokenPayload.sessionHandle !== payloadAfterCall.sessionHandle),
recipeId: recipe!.recipeID,
},
recipe!.recipeID,
Expand All @@ -144,9 +153,14 @@ export function useChildProps(

const onSignUpSuccess = useCallback(
async (result: { user: User }): Promise<void> => {
const payloadAfterSuccess = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({
userContext,
});
let payloadAfterCall;
try {
payloadAfterCall = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({
userContext,
});
} catch {
payloadAfterCall = undefined;
}
return Session.getInstanceOrThrow()
.validateGlobalClaimsAndHandleSuccessRedirection(
{
Expand All @@ -156,7 +170,8 @@ export function useChildProps(
newSessionCreated:
session.loading ||
!session.doesSessionExist ||
session.accessTokenPayload.sessionHandle !== payloadAfterSuccess.sessionHandle,
(payloadAfterCall !== undefined &&
session.accessTokenPayload.sessionHandle !== payloadAfterCall.sessionHandle),
recipeId: recipe!.recipeID,
},
recipe!.recipeID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,15 @@ const LinkClickedScreen: React.FC<PropType> = (props) => {
}

if (response.status === "OK") {
const payloadAfterSuccess = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({
userContext,
});
let payloadAfterCall;
try {
payloadAfterCall = await Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({
userContext,
});
} catch {
payloadAfterCall = undefined;
}

const loginAttemptInfo =
await props.recipe.webJSRecipe.getLoginAttemptInfo<AdditionalLoginAttemptInfoProperties>({
userContext,
Expand All @@ -129,7 +135,8 @@ const LinkClickedScreen: React.FC<PropType> = (props) => {
newSessionCreated:
session.loading ||
!session.doesSessionExist ||
session.accessTokenPayload.sessionHandle !== payloadAfterSuccess.sessionHandle,
(payloadAfterCall !== undefined &&
session.accessTokenPayload.sessionHandle !== payloadAfterCall.sessionHandle),
recipeId: props.recipe.recipeID,
},
props.recipe.recipeID,
Expand Down
Loading

0 comments on commit daf1e30

Please sign in to comment.