mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
Compare commits
5 Commits
ZOD-349-we
...
7194c38918
| Author | SHA1 | Date | |
|---|---|---|---|
| 7194c38918 | |||
| a3a61b4923 | |||
| 39d5fc1869 | |||
| 5649d24724 | |||
| 9d9408dedd |
@ -226,7 +226,15 @@ export class UserService {
|
||||
|
||||
if (userWithEmail) {
|
||||
if (userWithEmail.id === userId) {
|
||||
return;
|
||||
this.logger.log(`Generating OTP for current email ${email} for user ${userId}`);
|
||||
await this.userRepository.update(userId, { isEmailVerified: false });
|
||||
|
||||
return this.otpService.generateAndSendOtp({
|
||||
userId,
|
||||
recipient: email,
|
||||
otpType: OtpType.EMAIL,
|
||||
scope: OtpScope.VERIFY_EMAIL,
|
||||
});
|
||||
}
|
||||
|
||||
this.logger.error(`Email ${email} is already taken by another user`);
|
||||
|
||||
Reference in New Issue
Block a user