From f22da94ab47c4484fef631fb6fbd5ab1a8666c72 Mon Sep 17 00:00:00 2001 From: sdraris Date: Mon, 22 Sep 2025 09:59:08 +0200 Subject: [PATCH] test de push + hash comparing back --- src/routes/auth/auth.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/auth/auth.service.ts b/src/routes/auth/auth.service.ts index 1c27f15..215dd23 100644 --- a/src/routes/auth/auth.service.ts +++ b/src/routes/auth/auth.service.ts @@ -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) {