From 594842f3d36bb66b3ee0652250a7054924e5a146 Mon Sep 17 00:00:00 2001 From: kkatusic Date: Mon, 25 Nov 2024 13:04:05 +0100 Subject: [PATCH] Fix/Email verification only for verified users --- src/resolvers/userResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolvers/userResolver.ts b/src/resolvers/userResolver.ts index 67d78bd59..3043c6880 100644 --- a/src/resolvers/userResolver.ts +++ b/src/resolvers/userResolver.ts @@ -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) {