Fix password verification when adding new user
This commit is contained in:
parent
1aa378d930
commit
4a66630a00
2
js/dist/bundle.js
vendored
2
js/dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
2
js/dist/bundle.js.map
vendored
2
js/dist/bundle.js.map
vendored
File diff suppressed because one or more lines are too long
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user