1
0
forked from Yara724/api
This commit is contained in:
SepehrYahyaee
2026-01-18 16:46:44 +03:30
parent c1faacd1c0
commit 43dc852598

View File

@@ -1,4 +1,5 @@
import { import {
BadRequestException,
HttpException, HttpException,
HttpStatus, HttpStatus,
Injectable, Injectable,
@@ -96,6 +97,7 @@ export class UserAuthService {
return new LoginDtoRs(newUser); return new LoginDtoRs(newUser);
} }
if (userExist) { 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); await this.smsSender(otp, mobile);
const updateTokens = await this.userDbService.findOneAndUpdate( const updateTokens = await this.userDbService.findOneAndUpdate(
{ {