Merge branch 'main' into feat/sharing

This commit is contained in:
Philipinho
2025-04-09 20:22:44 +01:00
10 changed files with 76 additions and 32 deletions

View File

@ -1,6 +1,6 @@
{
"name": "server",
"version": "0.9.0",
"version": "0.10.0",
"description": "",
"author": "",
"private": true,

View File

@ -47,13 +47,18 @@ export class AuthService {
includePassword: true,
});
const errorMessage = 'email or password does not match';
if (!user || user?.deletedAt) {
throw new UnauthorizedException(errorMessage);
}
const isPasswordMatch = await comparePasswordHash(
loginDto.password,
user?.password,
user.password,
);
if (!user || !isPasswordMatch || user.deletedAt) {
throw new UnauthorizedException('email or password does not match');
if (!isPasswordMatch) {
throw new UnauthorizedException(errorMessage);
}
user.lastLoginAt = new Date();