Skip to content

Commit

Permalink
lowercase email in webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
elie222 committed Jan 22, 2025
1 parent 47e5466 commit 10f05f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/web/app/api/google/webhook/process-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export async function processHistoryForUser(
},
options?: { startHistoryId?: string },
) {
const { emailAddress: email, historyId } = decodedData;
const { emailAddress, historyId } = decodedData;
// All emails in the database are stored in lowercase
// But it's possible that the email address in the webhook is not
// So we need to convert it to lowercase
const email = emailAddress.toLowerCase();

const account = await prisma.account.findFirst({
where: { user: { email }, provider: "google" },
Expand Down

1 comment on commit 10f05f4

@vercel
Copy link

@vercel vercel bot commented on 10f05f4 Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.