PW confirmation

This commit is contained in:
Jörn-Michael Miehe 2019-05-06 17:21:21 +02:00
parent 939cc8d504
commit f39f80e64e

View file

@ -23,6 +23,16 @@
required required
counter counter
></v-text-field> ></v-text-field>
<v-text-field
v-if="!showPassword"
v-model="passwordConfirm"
:rules="passwordConfirmRules"
:type="showPassword ? 'text' : 'password'"
label="Confirm Password"
required
counter
></v-text-field>
</v-card-text> </v-card-text>
</FormDialog> </FormDialog>
</template> </template>
@ -43,9 +53,19 @@ export default {
password: '', password: '',
showPassword: false, showPassword: false,
passwordRules: [v => !!v || 'Password is required'] passwordRules: [v => !!v || 'Password is required'],
passwordConfirm: '',
}), }),
computed: {
passwordConfirmRules() {
return [
() => this.password === this.passwordConfirm || "Passwords don't match"
]
},
},
methods: { methods: {
confirm() { confirm() {
window.pkgs.axios window.pkgs.axios