diff --git a/src/components/user/Config.vue b/src/components/user/Config.vue index 2cd036c..ab89eb3 100644 --- a/src/components/user/Config.vue +++ b/src/components/user/Config.vue @@ -48,7 +48,7 @@ @@ -58,7 +58,7 @@ ref="password" v-model="controlPassword" outlined - label="Password bestätigen" + label="neues Password bestätigen" type="password" :disabled="!password" :rules="[equal_password]" @@ -242,6 +242,7 @@ + Speicherns @@ -296,6 +297,8 @@ export default { controlPassword: null, trashCan: mdiTrashCan, isFulllineText: false, + acceptedPassword: null, + passError: null, equal_password: value => this.password === value || 'Passwörter sind nicht identisch.', email: value => { @@ -304,7 +307,11 @@ export default { return pattern.test(value) || 'keine gültige E-Mail' } return true + }, + empty_password: () => { + return this.acceptedPassword !== null ? true : 'Password wurde nicht gesetzt' } + } }, mounted() { @@ -334,9 +341,14 @@ export default { if (this.$refs.password.validate()) { if (this.password) user.password = this.password } - this.saveConfig({ oldUsername: user.username, ...user }) + if (this.$refs.acceptedPassword.validate()) { + this.saveConfig({oldUsername: user.username, ...user, acceptedPassword: this.acceptedPassword}) + } else { + this.passError = "Du musst dein Password eingeben" + } this.password = null this.controlPassword = null + this.acceptedPassword = '' }, calcLifefime(time) { if (time < 60) return String(time) + 'Sekunden'