From 7862099474664dbd9249329163df8a657e5b9470 Mon Sep 17 00:00:00 2001 From: sambokar Date: Tue, 17 Sep 2024 09:06:09 -0400 Subject: [PATCH] adding console logging statements to debug login failures --- frontend/app/api/auth/[[...nextauth]]/route.ts | 1 + frontend/components/processors/processorhelperfunctions.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/app/api/auth/[[...nextauth]]/route.ts b/frontend/app/api/auth/[[...nextauth]]/route.ts index 61380033..447a9551 100644 --- a/frontend/app/api/auth/[[...nextauth]]/route.ts +++ b/frontend/app/api/auth/[[...nextauth]]/route.ts @@ -24,6 +24,7 @@ const handler = NextAuth({ console.log('process envs: ', process.env); const azureProfile = profile as AzureADProfile; const userEmail = user.email || signInEmail || azureProfile.preferred_username; + console.log('user email: ', userEmail); if (typeof userEmail !== 'string') { console.error('User email is not a string:', userEmail); return false; // Email is not a valid string, abort sign-in diff --git a/frontend/components/processors/processorhelperfunctions.tsx b/frontend/components/processors/processorhelperfunctions.tsx index e8ad1aab..f17f9c4e 100644 --- a/frontend/components/processors/processorhelperfunctions.tsx +++ b/frontend/components/processors/processorhelperfunctions.tsx @@ -69,6 +69,7 @@ export async function verifyEmail(email: string): Promise<{ emailVerified: boole WHERE Email = ? LIMIT 1`; const results = await runQuery(connection, query, [email]); + console.log('results: ', results); // emailVerified is true if there is at least one result const emailVerified = results.length > 0;