mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: password can be changed with wrong password
This commit is contained in:
parent
067652aa80
commit
0ccb836444
1 changed files with 1 additions and 1 deletions
|
@ -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");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue