diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue index 756e72d2a..495dec3d2 100755 --- a/frontend/src/components/SidebarPlugin/SideBar.vue +++ b/frontend/src/components/SidebarPlugin/SideBar.vue @@ -85,7 +85,7 @@ export default { default: 'img/brand/green.png', description: 'Gradido Sidebar app logo', }, - value: { type: Array }, + value: { type: String }, autoClose: { type: Boolean, default: true, diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue index 1fa26b5e0..254c0cb9e 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue @@ -68,7 +68,7 @@
- + {{ $t('form.password_old') }} @@ -43,6 +43,7 @@ + {{ $t('form.password_new') }} @@ -89,10 +90,31 @@ + + + + +
+
    +
  • + {{ error }} +
  • +
+
+
+
+
+
- + {{ $t('form.save') }}
@@ -132,7 +154,12 @@ export default { this.passwordVisibleOldPwd = !this.passwordVisibleOldPwd }, loadSubmitButton() { - if (this.passwordVisibleNewPwd === this.passwordVisibleNewPwdRepeat) { + if ( + this.password !== '' && + this.passwordNew !== '' && + this.passwordNewRepeat !== '' && + this.passwordNew === this.passwordNewRepeat + ) { this.loading = false } else { this.loading = true @@ -153,6 +180,31 @@ export default { } }, }, + computed: { + samePasswords() { + return this.password === this.passwordNew + }, + rules() { + return [ + { message: this.$t('site.signup.lowercase'), regex: /[a-z]+/ }, + { message: this.$t('site.signup.uppercase'), regex: /[A-Z]+/ }, + { message: this.$t('site.signup.minimum'), regex: /.{8,}/ }, + { message: this.$t('site.signup.one_number'), regex: /[0-9]+/ }, + ] + }, + passwordValidation() { + const errors = [] + for (const condition of this.rules) { + if (!condition.regex.test(this.passwordNew)) { + errors.push(condition.message) + } + } + if (errors.length === 0) { + return { valid: true, errors } + } + return { valid: false, errors } + }, + }, }