Skip to content

Commit

Permalink
feat: added more debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Sep 30, 2024
1 parent a9f7716 commit 6f47455
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .circleci/setupAndTestWithAuthReact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ cd ../../../supertokens-auth-react/
# flag will not be checked because Auth0 is used as a provider so that the Thirdparty tests can run reliably.
# In versions lower than 0.18 Github is used as the provider.

MOCHA_FILE=test_report/report_node.xml SKIP_OAUTH=true npm run test-with-non-node
DEBUG=com.supertokens MOCHA_FILE=test_report/report_node.xml SKIP_OAUTH=true npm run test-with-non-node
if [[ $? -ne 0 ]]
then
mkdir -p ../project/test_report/screenshots
Expand Down
33 changes: 22 additions & 11 deletions lib/build/authUtils.js

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

35 changes: 24 additions & 11 deletions lib/ts/authUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,17 +1021,30 @@ export const AuthUtils = {
req
);

return shouldTryLinkingWithSessionUser !== false || overwriteSessionDuringSignInUp === false
? await Session.getSession(
req,
res,
{
sessionRequired: shouldTryLinkingWithSessionUser === true,
overrideGlobalClaimValidators: () => [],
},
userContext
)
: undefined;
if (shouldTryLinkingWithSessionUser === false) {
logDebugMessage(
"loadSessionInAuthAPIIfNeeded: skipping session loading because shouldTryLinkingWithSessionUser is false"
);
return undefined;
}

if (overwriteSessionDuringSignInUp === false) {
logDebugMessage(
"loadSessionInAuthAPIIfNeeded: skipping session loading because overwriteSessionDuringSignInUp is false"
);
return undefined;
}
logDebugMessage("loadSessionInAuthAPIIfNeeded: loading session");

return await Session.getSession(
req,
res,
{
sessionRequired: shouldTryLinkingWithSessionUser === true,
overrideGlobalClaimValidators: () => [],
},
userContext
);
},
};

Expand Down

0 comments on commit 6f47455

Please sign in to comment.