Commit 4025884b authored by vietanh-0511's avatar vietanh-0511

password_confirmation

parent 37a18de0
......@@ -33,15 +33,15 @@
@click:append="showPassword = !showPassword"
/>
<v-text-field
v-model="confirmPassword"
v-model="password_confirmation "
:error-messages="confirmPasswordErrors"
:append-icon="showConfirmPassword ? 'mdi-eye' : 'mdi-eye-off'"
:type="showConfirmPassword ? 'text' : 'password'"
label="confirmPassword"
hint="At least 6 characters"
required
@input="$v.confirmPassword.$touch()"
@blur="$v.confirmPassword.$touch()"
@input="$v.password_confirmation .$touch()"
@blur="$v.password_confirmation .$touch()"
@click:append="showConfirmPassword = !showConfirmPassword"
/>
<v-btn class="mr-4" type="submit">
......@@ -70,14 +70,14 @@ export default {
name: { required, minLength: minLength(1), maxLength: maxLength(255) },
email: { required, email },
password: { required, minLength: minLength(6) },
confirmPassword: { required, sameAsPassword: sameAs('password') }
password_confirmation: { required, sameAsPassword: sameAs('password') }
},
data: () => ({
name: '',
email: '',
password: '',
confirmPassword: '',
password_confirmation: '',
showPassword: false,
showConfirmPassword: false
}),
......@@ -113,11 +113,11 @@ export default {
},
confirmPasswordErrors () {
const errors = []
if (!this.$v.confirmPassword.$dirty) {
if (!this.$v.password_confirmation.$dirty) {
return errors
}
!this.$v.confirmPassword.required && errors.push('Password confirmation is required')
!this.$v.confirmPassword.sameAsPassword && errors.push('Password and confirm password does not match')
!this.$v.password_confirmation.required && errors.push('Password confirmation is required')
!this.$v.password_confirmation.sameAsPassword && errors.push('Password and confirm password does not match')
return errors
}
},
......@@ -131,7 +131,7 @@ export default {
this.name = ''
this.email = ''
this.password = ''
this.confirmPassword = ''
this.password_confirmation = ''
},
async signup () {
try {
......@@ -139,7 +139,7 @@ export default {
name: this.name,
email: this.email,
password: this.password,
confirm_password: this.confirm_password
password_confirmation: this.password_confirmation
}
).then((resp) => {
if (resp.data.status === 'success') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment