From 9c381a2ed6b3b7dfd95d4278889b937ffb85e01b Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Sun, 25 Aug 2024 16:00:49 +0200 Subject: [PATCH] fix: internal server error if user has no password when trying to sign in --- backend/src/auth/auth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/auth/auth.service.ts b/backend/src/auth/auth.service.ts index 1efef082..aa4ab031 100644 --- a/backend/src/auth/auth.service.ts +++ b/backend/src/auth/auth.service.ts @@ -76,7 +76,7 @@ export class AuthService { }, }); - if (user && await argon.verify(user.password, dto.password)) { + if (user?.password && await argon.verify(user.password, dto.password)) { this.logger.log(`Successful password login for user ${user.email} from IP ${ip}`); return this.generateToken(user); }