Merge pull request #95 from SyncrowIOT/feature/otp-config

added otp handling user
This commit is contained in:
yousef-khriasat-uba
2024-09-12 16:32:03 +03:00
committed by GitHub
+9 -1
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) {