fix: password can be changed with wrong password

This commit is contained in:
Elias Schneider
2024-01-14 14:14:07 +01:00
parent 067652aa80
commit 0ccb836444

View File

@@ -139,7 +139,7 @@ export class AuthService {
async updatePassword(user: User, newPassword: string, oldPassword?: string) {
const isPasswordValid =
!user.password || !(await argon.verify(user.password, oldPassword));
!user.password || await argon.verify(user.password, oldPassword);
if (!isPasswordValid) throw new ForbiddenException("Invalid password");