From a12378ed8b25737bb131d546312fcbb50cd44c63 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 27 Jan 2022 10:33:06 +0100 Subject: [PATCH] Checks if User has activated his Email before saving a open creation. --- backend/src/graphql/resolver/AdminResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 7e61b4c1d..8940c29ea 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -60,8 +60,8 @@ export class AdminResolver { ): Promise { const userRepository = getCustomRepository(UserRepository) const user = await userRepository.findByEmail(email) - - if (!user.disabled) { + const isActivated = await hasActivatedEmail(user.email) + if (isActivated) { const creations = await getUserCreations(user.id) const creationDateObj = new Date(creationDate) if (isCreationValid(creations, amount, creationDateObj)) {