test de push + hash comparing back

This commit is contained in:
sdraris 2025-09-22 09:59:08 +02:00
parent a1283bf210
commit f22da94ab4

View File

@ -49,13 +49,13 @@ export class AuthService {
throw new UnauthorizedException('Email invalide');
}
// const isMatch = await bcrypt.compare(dto.password, user.password);
// if (!isMatch) {
// throw new UnauthorizedException('Mot de passe invalide');
// }
if (user.password !== dto.password) {
const isMatch = await bcrypt.compare(dto.password, user.password);
if (!isMatch) {
throw new UnauthorizedException('Mot de passe invalide');
}
// if (user.password !== dto.password) {
// throw new UnauthorizedException('Mot de passe invalide');
// }
return this.generateTokens(user.id, user.email, user.role);
} catch (error) {