From 7f15b3c22ab578cc44abb1a5e2c79aee9ce56f2b Mon Sep 17 00:00:00 2001 From: mohamed-sameh-albaz <136837275+mohamed-sameh-albaz@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:38:50 +0200 Subject: [PATCH] fix verify password response --- src/auth/auth.controller.ts | 2 +- src/auth/services/password/password.service.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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'); } }