mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 09:57:55 +00:00
added otp handling user
This commit is contained in:
@@ -225,7 +225,15 @@ export class UserAuthService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!otp) {
|
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) {
|
if (otp.otpCode !== data.otpCode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user