mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 18:14:55 +00:00
added otp handling user
This commit is contained in:
@ -225,8 +225,16 @@ export class UserAuthService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!otp) {
|
if (!otp) {
|
||||||
|
const user = await this.userRepository.findOne({
|
||||||
|
where: {
|
||||||
|
email: data.email,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (user) {
|
||||||
throw new BadRequestException('this email is not registered');
|
throw new BadRequestException('this email is not registered');
|
||||||
}
|
}
|
||||||
|
throw new BadRequestException('You entered wrong otp');
|
||||||
|
}
|
||||||
|
|
||||||
if (otp.otpCode !== data.otpCode) {
|
if (otp.otpCode !== data.otpCode) {
|
||||||
throw new BadRequestException('You entered wrong otp');
|
throw new BadRequestException('You entered wrong otp');
|
||||||
|
|||||||
Reference in New Issue
Block a user