From afd41475c9a9591ff904531ef1f9076392e4f1c0 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Fri, 7 Jul 2023 01:55:00 +0200 Subject: [PATCH] fix: update should be based on email only (#9977) --- packages/features/auth/lib/next-auth-options.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/features/auth/lib/next-auth-options.ts b/packages/features/auth/lib/next-auth-options.ts index 122bfab85c..9d06eb62e5 100644 --- a/packages/features/auth/lib/next-auth-options.ts +++ b/packages/features/auth/lib/next-auth-options.ts @@ -616,10 +616,7 @@ export const AUTH_OPTIONS: AuthOptions = { ) { await prisma.user.update({ where: { - email_username: { - email: existingUserWithEmail.email, - username: existingUserWithEmail.username!, - }, + email: existingUserWithEmail.email, }, data: { // update the email to the IdP email