fix verification endpoint

This commit is contained in:
2023-08-03 19:17:20 +02:00
parent eb9569adee
commit 582c2885ed

View File

@@ -26,7 +26,7 @@ export class VerifyEmailHandler implements ICommandHandler<VerifyEmailCommand> {
const isTokenExpired = isBefore(verificationWithUser.verificationTokenExpiry, new Date()) const isTokenExpired = isBefore(verificationWithUser.verificationTokenExpiry, new Date())
if (dbToken !== token || isTokenExpired) { if (dbToken !== token || isTokenExpired) {
return false throw new BadRequestException('Incorrect or expired token')
} }
const result = await this.usersRepository.updateEmailVerification(verificationWithUser.userId) const result = await this.usersRepository.updateEmailVerification(verificationWithUser.userId)