From 95a315db8f6d79302fe7333df7393862d627bda6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Aug 2024 11:22:08 +0300 Subject: [PATCH] added otp limiter --- src/auth/services/user-auth.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth/services/user-auth.service.ts b/src/auth/services/user-auth.service.ts index 4df01db..9a9c670 100644 --- a/src/auth/services/user-auth.service.ts +++ b/src/auth/services/user-auth.service.ts @@ -42,7 +42,7 @@ export class UserAuthService { throw new BadRequestException('User already registered with given email'); } const salt = this.helperHashService.randomSalt(10); // Hash the password using bcrypt - const hashedPassword = this.helperHashService.bcrypt( + const hashedPassword = await this.helperHashService.bcrypt( userSignUpDto.password, salt, ); @@ -124,7 +124,7 @@ export class UserAuthService { sessionId: session[1].uuid, }); } catch (error) { - throw new UnauthorizedException('User unauthorized'); + throw new BadRequestException('Invalid credentials'); } }