From 2b9ec132b990380074beab7390507873f4a11ce9 Mon Sep 17 00:00:00 2001 From: Richard Xia Date: Sun, 16 Jun 2024 15:08:47 -0700 Subject: [PATCH] Add more logging statements around authentication. (#1363) 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. --- app/utils/AuthService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/utils/AuthService.ts b/app/utils/AuthService.ts index b4025cf72..c4bf94051 100644 --- a/app/utils/AuthService.ts +++ b/app/utils/AuthService.ts @@ -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"); @@ -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( {