test de push + hash comparing back
This commit is contained in:
parent
a1283bf210
commit
f22da94ab4
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user