From 2649ae72e2a39c1c0e7a9f058318734ada32ced8 Mon Sep 17 00:00:00 2001 From: "yuniel.acosta" Date: Wed, 15 Jul 2020 22:35:39 -0400 Subject: [PATCH] Use sameAs function in confirm password --- .../change-password.component.ts.ejs | 9 +++++---- .../change-password/change-password.vue.ejs | 14 +++----------- .../finish/reset-password-finish.component.ts.ejs | 9 +++++---- .../finish/reset-password-finish.vue.ejs | 14 +++----------- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.component.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.component.ts.ejs index ad5ad9bc..578029be 100644 --- a/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.component.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.component.ts.ejs @@ -1,4 +1,4 @@ -import { maxLength, minLength, required } from 'vuelidate/lib/validators'; +import { maxLength, minLength, required, sameAs } from 'vuelidate/lib/validators'; import axios from 'axios'; import { mapGetters } from 'vuex'; import Component from 'vue-class-component'; @@ -15,9 +15,10 @@ const validations = { maxLength: maxLength(254) }, confirmPassword: { - required, - minLength: minLength(4), - maxLength: maxLength(254) + // prettier-ignore + sameAsPassword: sameAs(vm => { + return vm.newPassword; + }) } } }; diff --git a/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.vue.ejs b/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.vue.ejs index 9d9e675f..847fe54c 100644 --- a/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.vue.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/account/change-password/change-password.vue.ejs @@ -59,17 +59,9 @@ v-bind:placeholder="$t('global.form[\'confirmpassword.placeholder\']')" v-model="$v.resetPassword.confirmPassword.$model" minlength=4 maxlength=50 required>
- - Your confirmation password is required. - - - Your confirmation password is required to be at least 4 characters. - - - Your confirmation password cannot be longer than 50 characters. + + The password and its confirmation do not match!
diff --git a/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.component.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.component.ts.ejs index fc05d5db..5043c7bf 100644 --- a/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.component.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.component.ts.ejs @@ -1,5 +1,5 @@ import axios from 'axios'; -import { maxLength, minLength, required } from 'vuelidate/lib/validators'; +import { maxLength, minLength, required, sameAs } from 'vuelidate/lib/validators'; import { Inject, Vue, Component } from 'vue-property-decorator'; import LoginService from '@/account/login.service'; @@ -11,9 +11,10 @@ const validations = { maxLength: maxLength(254) }, confirmPassword: { - required, - minLength: minLength(4), - maxLength: maxLength(254) + // prettier-ignore + sameAsPassword: sameAs(vm => { + return vm.newPassword; + }) } } }; diff --git a/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.vue.ejs b/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.vue.ejs index e38f088f..8552bce2 100644 --- a/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.vue.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/account/reset-password/finish/reset-password-finish.vue.ejs @@ -56,17 +56,9 @@ v-bind:placeholder="$t('global.form[\'confirmpassword.placeholder\']')" v-model="$v.resetAccount.confirmPassword.$model" minlength=4 maxlength=50 required>
- - Your confirmation password is required. - - - Your confirmation password is required to be at least 4 characters. - - - Your confirmation password cannot be longer than 50 characters. + + The password and its confirmation do not match!