mirror of
https://github.com/docmost/docmost.git
synced 2025-11-18 15:41:15 +10:00
Merge branch 'main' into feat/sharing
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.9.0",
|
||||
"version": "0.10.0",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user