changed date string to iso

This commit is contained in:
unknown
2024-10-27 15:47:39 +03:00
parent 008fe0a515
commit ccf3e34fbf
2 changed files with 6 additions and 4 deletions

View File

@ -256,11 +256,13 @@ export class UserAuthService {
throw new BadRequestException('You entered wrong otp');
}
if (otp.expiryTime < new Date() || fromNewPassword) {
if (otp.expiryTime < new Date()) {
await this.otpRepository.delete(otp.uuid);
throw new BadRequestException('OTP expired');
}
if (fromNewPassword) {
await this.otpRepository.delete(otp.uuid);
}
if (data.type == OtpType.VERIFICATION) {
await this.userRepository.update(
{ email: data.email },