From 43dc8525984329ac18fce9bb5d5bed50bb1a61da Mon Sep 17 00:00:00 2001 From: SepehrYahyaee <7heycallmegray@gmail.com> Date: Sun, 18 Jan 2026 16:46:44 +0330 Subject: [PATCH] YARA-695 --- src/auth/auth-services/user.auth.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auth/auth-services/user.auth.service.ts b/src/auth/auth-services/user.auth.service.ts index 882a565..347377d 100644 --- a/src/auth/auth-services/user.auth.service.ts +++ b/src/auth/auth-services/user.auth.service.ts @@ -1,4 +1,5 @@ import { + BadRequestException, HttpException, HttpStatus, Injectable, @@ -96,6 +97,7 @@ export class UserAuthService { return new LoginDtoRs(newUser); } if (userExist) { + if (userExist.otpExpire > new Date(new Date().getTime()).getTime()) throw new BadRequestException("Wait for expiry time to finish"); await this.smsSender(otp, mobile); const updateTokens = await this.userDbService.findOneAndUpdate( {