Skip to content

Commit

Permalink
Fix/Email verification only for verified users
Browse files Browse the repository at this point in the history
  • Loading branch information
kkatusic committed Nov 25, 2024
1 parent 5d7a1d0 commit 594842f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resolvers/userResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ export class UserResolver {
);
}

// Check do we have an email already in the database
// Check do we have an email already in the database and is it verified
const isEmailAlreadyUsed = await User.findOne({
where: { email: email },
where: { email: email, isEmailVerified: true },
});

if (isEmailAlreadyUsed && isEmailAlreadyUsed.id !== user.id) {
Expand Down

0 comments on commit 594842f

Please sign in to comment.