Skip to content

Commit 9e5b558

Browse files
authored
Merge pull request #123 from import-ai/fix/auth
fix(auth): friendly error messages
2 parents 19d25ea + 022830f commit 9e5b558

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/auth/auth.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export class AuthService {
4040
async verify(email: string, password: string): Promise<any> {
4141
const user = await this.userService.verify(email, password);
4242
if (!user) {
43+
const userUseEmail = await this.userService.findByEmail(email);
44+
if (userUseEmail) {
45+
throw new ForbiddenException('Wrong password, please check');
46+
}
4347
throw new ForbiddenException(
4448
'No account found for the provided email. Please register first.',
4549
);

0 commit comments

Comments
 (0)