diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index dbbf0de..299329c 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -319,17 +319,14 @@ export class AuthService { where: { email: dto.email.toLowerCase() }, }); - // Always return success to prevent email enumeration if (!user) { - return { - message: 'If the email exists, a password reset link will be sent', - }; + throw new NotFoundException('No account found with this email address'); } if (!user.password) { - return { - message: 'If the email exists, a password reset link will be sent', - }; + throw new BadRequestException( + 'This account uses social login (Google/Facebook). Please sign in with your social account.', + ); } // Generate reset token (short-lived JWT) @@ -350,7 +347,7 @@ export class AuthService { }); return { - message: 'If the email exists, a password reset link will be sent', + message: 'Password reset link has been sent to your email', }; }