From 68611b227bf9994a1e14ad25878cead08f208433 Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 20 Aug 2024 16:45:32 +0330 Subject: [PATCH 1/2] fix problem in email confirmation reset --- src/resolvers/userResolver.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/resolvers/userResolver.ts b/src/resolvers/userResolver.ts index 508b38c53..efbb98223 100644 --- a/src/resolvers/userResolver.ts +++ b/src/resolvers/userResolver.ts @@ -190,6 +190,10 @@ export class UserResolver { emailConfirmationSentAt: null, }); } + dbUser.emailConfirmed = false; + dbUser.emailConfirmedAt = null; + dbUser.emailConfirmationSent = false; + dbUser.emailConfirmationSentAt = null; dbUser.email = email; } if (url !== undefined) { From 62aed4bb9b559d58e1117b8c0c0342350448be18 Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 20 Aug 2024 16:59:34 +0330 Subject: [PATCH 2/2] reset email confirmation only when email changes --- src/resolvers/userResolver.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/resolvers/userResolver.ts b/src/resolvers/userResolver.ts index efbb98223..a1947e841 100644 --- a/src/resolvers/userResolver.ts +++ b/src/resolvers/userResolver.ts @@ -189,12 +189,12 @@ export class UserResolver { emailConfirmationSent: false, emailConfirmationSentAt: null, }); + dbUser.emailConfirmed = false; + dbUser.emailConfirmedAt = null; + dbUser.emailConfirmationSent = false; + dbUser.emailConfirmationSentAt = null; + dbUser.email = email; } - dbUser.emailConfirmed = false; - dbUser.emailConfirmedAt = null; - dbUser.emailConfirmationSent = false; - dbUser.emailConfirmationSentAt = null; - dbUser.email = email; } if (url !== undefined) { dbUser.url = url;