Skip to content

Commit

Permalink
fix: change passwd enc. and allow empty oldpasswd
Browse files Browse the repository at this point in the history
  • Loading branch information
MenxLi committed Nov 17, 2023
1 parent bd1d096 commit b5faae5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lires_web/src/components/dashboard/UserCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@
}
// maybe update the password
if (settings_oldPassword.value !== "" || settings_newPassword.value !== "" || settings_confirmNewPassword.value !== ""){
if (settings_newPassword.value !== "" || settings_confirmNewPassword.value !== ""){
// check completeness
if (settings_oldPassword.value === ""){
useUIStateStore().showPopup("Please enter the old password", "error");
return;
}
if (settings_newPassword.value === ""){
useUIStateStore().showPopup("Please enter the new password", "error");
return;
Expand All @@ -80,7 +76,7 @@
}
// update the password
if (useSettingsStore().encKey !== sha256(props.userInfo.username + settings_oldPassword.value)){
if (useSettingsStore().encKey !== sha256(props.userInfo.username + sha256(settings_oldPassword.value))){
useUIStateStore().showPopup("The old password is incorrect", "error");
return;
}
Expand Down

0 comments on commit b5faae5

Please sign in to comment.