Fix password verification when adding new user

This commit is contained in:
Bartek Fabiszewski 2020-04-08 18:47:32 +02:00
parent 1aa378d930
commit 4a66630a00
3 changed files with 5 additions and 3 deletions

2
js/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -87,6 +87,7 @@ export default class UserDialogModel extends ViewModel {
} }
onPassChange() { onPassChange() {
this.model.passVisibility = true;
if (this.validate()) { if (this.validate()) {
auth.user.setPassword(this.model.password, this.model.oldPassword) auth.user.setPassword(this.model.password, this.model.oldPassword)
.then(() => this.dialog.destroy()) .then(() => this.dialog.destroy())
@ -95,6 +96,7 @@ export default class UserDialogModel extends ViewModel {
} }
onUserAdd() { onUserAdd() {
this.model.passVisibility = true;
if (this.validate()) { if (this.validate()) {
uUser.add(this.model.login, this.model.password, this.model.admin).then((user) => { uUser.add(this.model.login, this.model.password, this.model.admin).then((user) => {
this.userVM.onUserAdded(user); this.userVM.onUserAdded(user);
@ -123,7 +125,7 @@ export default class UserDialogModel extends ViewModel {
return false; return false;
} }
} }
if (this.type === 'pass' || this.model.passVisibility) { if (this.model.passVisibility) {
if (!this.model.password || !this.model.password2) { if (!this.model.password || !this.model.password2) {
alert($._('allrequired')); alert($._('allrequired'));
return false; return false;