mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 10:46:17 +00:00
added otp handling user
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user