Skip to content

Commit

Permalink
adding console logging statements to debug login failures
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Sep 17, 2024
1 parent b2b85e7 commit 7862099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/app/api/auth/[[...nextauth]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7862099

Please sign in to comment.