added otp handling user

This commit is contained in:
unknown
2024-09-12 16:31:15 +03:00
parent 9070eb8de5
commit 21d31538be

View File

@ -225,7 +225,15 @@ export class UserAuthService {
});
if (!otp) {
throw new BadRequestException('this email is not registered');
const user = await this.userRepository.findOne({
where: {
email: data.email,
},
});
if (user) {
throw new BadRequestException('this email is not registered');
}
throw new BadRequestException('You entered wrong otp');
}
if (otp.otpCode !== data.otpCode) {