Skip to content

Commit

Permalink
🐛 Fix bug where data migration happens before email verification (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella authored Jan 16, 2025
1 parent f047676 commit aad31ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 3 additions & 5 deletions apps/web/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aad31ff

Please sign in to comment.