diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 9c44edf..fc05ad8 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -772,7 +772,7 @@ export class AuthController { data: { isValid, }, - message: isValid ? 'Password is correct' : 'Password is incorrect', + message: 'Correct Password', }; } } diff --git a/src/auth/services/password/password.service.ts b/src/auth/services/password/password.service.ts index 67b75ba..eb9a7a0 100644 --- a/src/auth/services/password/password.service.ts +++ b/src/auth/services/password/password.service.ts @@ -188,6 +188,10 @@ export class PasswordService { throw new NotFoundException('User not found'); } - return await this.verify(user.password, password); + const isMatched: boolean = await this.verify(user.password, password); + if (isMatched) { + return true; + } + throw new BadRequestException('incorrect password'); } }