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'); } }