diff --git a/resources/assets/vue/components/accounts/forms/CompleteRegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/CompleteRegistrationFormComponent.vue index 043c214b..79eb616c 100644 --- a/resources/assets/vue/components/accounts/forms/CompleteRegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/CompleteRegistrationFormComponent.vue @@ -220,7 +220,7 @@ const rules = computed(() => ({ }, password_confirmation: { required: requiredIf(() => step.value === 2), - sameAs: sameAs(parameters.password) + sameAs: sameAs(parameters.password, 'password') }, identification_no: { required: requiredIf(() => step.value === 1) diff --git a/resources/assets/vue/components/accounts/forms/InviteRegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/InviteRegistrationFormComponent.vue index 703668cc..1503f970 100644 --- a/resources/assets/vue/components/accounts/forms/InviteRegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/InviteRegistrationFormComponent.vue @@ -112,7 +112,7 @@ const rules = computed(() => ({ password: { required }, password_confirmation: { required, - sameAs: sameAs(parameters.password) + sameAs: sameAs(parameters.password, 'password') } } })); diff --git a/resources/assets/vue/components/accounts/forms/NewRegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/NewRegistrationFormComponent.vue index ea3e48a7..99bc6249 100644 --- a/resources/assets/vue/components/accounts/forms/NewRegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/NewRegistrationFormComponent.vue @@ -108,7 +108,7 @@ const rules = computed(() => ({ password: { required }, password_confirmation: { required, - sameAs: sameAs(parameters.password) + sameAs: sameAs(parameters.password, 'password') }, } })); diff --git a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue index be1dc7d6..921d618f 100644 --- a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue @@ -308,7 +308,7 @@ const rules = computed(() => ({ }, password_confirmation: { required: requiredIf(() => step.value === 2), - sameAs: sameAs(parameters.password) + sameAs: sameAs(parameters.password, 'password') }, identification_no: { required: requiredIf(() => step.value === 1) diff --git a/resources/assets/vue/components/general/forms/ValidationErrorComponent.vue b/resources/assets/vue/components/general/forms/ValidationErrorComponent.vue index 11555469..d94d0aa1 100644 --- a/resources/assets/vue/components/general/forms/ValidationErrorComponent.vue +++ b/resources/assets/vue/components/general/forms/ValidationErrorComponent.vue @@ -40,7 +40,11 @@ const getErrorMessage = (error: ValidationErrorItem): string => { if (validatorName === 'minLength') return `${errorMessages.minLength} ${params.min} characters`; if (validatorName === 'maxLength') return `${errorMessages.maxLength} ${params.max} characters`; - if (validatorName === 'sameAs') return `${errorMessages.sameAs} ${params.eq} field`; + if (validatorName === 'sameAs' || validatorName === 'sameAsPassword') { + let fieldName = params.otherName || params.eq || 'password'; + if (fieldName === 'password') fieldName = 'password'; + return `${errorMessages.sameAs} ${fieldName} field`; + } if (validatorName === 'minValue') return `${errorMessages.minValue} ${params.min}`; if (validatorName === 'maxValue') return `${errorMessages.maxValue} ${params.max}`; diff --git a/resources/assets/vue/components/user/form/UserFormComponent.vue b/resources/assets/vue/components/user/form/UserFormComponent.vue index 86689155..41f5e5fe 100644 --- a/resources/assets/vue/components/user/form/UserFormComponent.vue +++ b/resources/assets/vue/components/user/form/UserFormComponent.vue @@ -94,7 +94,7 @@ const rules = computed(() => ({ password: { required, minLength: minLength(6) }, password_confirmation: { required, - sameAsPassword: sameAs(parameters.value.password) + sameAs: sameAs(parameters.value.password, 'password') } } }));