From aad31ff722e06eec107f410f0128f3013bf5bc0a Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 16 Jan 2025 18:56:18 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bug=20where=20data=20migra?= =?UTF-8?q?tion=20happens=20before=20email=20verification=20(#1500)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- apps/web/src/auth.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 828218b14b2..3af3e0e63be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,7 +88,7 @@ jobs: - name: Upload artifact playwright-report if: ${{ success() || failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: playwright-report path: ./apps/web/playwright-report diff --git a/apps/web/src/auth.ts b/apps/web/src/auth.ts index 5062d628555..29cadd27607 100644 --- a/apps/web/src/auth.ts +++ b/apps/web/src/auth.ts @@ -235,16 +235,14 @@ const getAuthOptions = (...args: GetServerSessionParams) => // to display on the dashboard. The flow can be modified so that // the name is requested after the user has logged in. if (email?.verificationRequest) { - const isUnregisteredUser = + const isRegisteredUser = (await prisma.user.count({ where: { email: user.email as string, }, - })) === 0; + })) > 0; - if (isUnregisteredUser) { - return false; - } + return isRegisteredUser; } // when we login with a social account for the first time, the user is not created yet