Skip to content

Commit

Permalink
Add more logging statements around authentication. (#1363)
Browse files Browse the repository at this point in the history
We're still hitting issues in prod related to authentication, and adding
logging around the `passwordlessLogin` function and the state tokens
will help us debug it.
  • Loading branch information
richardxia authored Jun 16, 2024
1 parent 18ff094 commit 2b9ec13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/utils/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const initializeUserSession = (
// eslint-disable-next-line no-console
console.log("cookies exist? ", document.cookie);
const stateToken = sessionStorage.getItem("authStateToken") ?? "";
console.log(`Getting authStateToken: ${stateToken}`);
authClient.parseHash({ hash, state: stateToken }, (err, authResult) => {
sessionStorage.removeItem("authStateToken");

Expand Down Expand Up @@ -107,7 +108,9 @@ export const passwordlessLogin = (
email: string,
verificationCode: string
) => {
console.log("In passwordlessLogin");
const stateToken = createStateToken();
console.log(`Setting authStateToken: ${stateToken}`);
sessionStorage.setItem("authStateToken", stateToken);
authClient.passwordlessLogin(
{
Expand Down

0 comments on commit 2b9ec13

Please sign in to comment.