mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-19 13:33:13 +02:00
fix: password can be changed with wrong password
This commit is contained in:
@@ -139,7 +139,7 @@ export class AuthService {
|
|||||||
|
|
||||||
async updatePassword(user: User, newPassword: string, oldPassword?: string) {
|
async updatePassword(user: User, newPassword: string, oldPassword?: string) {
|
||||||
const isPasswordValid =
|
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");
|
if (!isPasswordValid) throw new ForbiddenException("Invalid password");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user