mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 01:01:07 +03:30
78 lines
3.3 KiB
Vue
78 lines
3.3 KiB
Vue
<template>
|
|
<v-form ref="form">
|
|
<v-container grid-list-xs>
|
|
<v-layout row wrap class="justify-center">
|
|
<v-flex xs12 md3 sm3 class="WM-WidthScreen-SM WM-WidthScreen-XS">
|
|
<material-card color="black" title="Change Password">
|
|
<v-layout row wrap class="px-3">
|
|
<v-flex xs12 md12 sm12>
|
|
<v-text-field
|
|
v-model="form.password"
|
|
label="Password"
|
|
:type="show1 ? 'text' : 'password'"
|
|
:append-icon="show1 ? 'visibility' : 'visibility_off'"
|
|
@click:append="show1 = !show1"
|
|
:rules="[rules.required, rules.passCounter]"
|
|
color="black"
|
|
></v-text-field>
|
|
</v-flex>
|
|
<v-flex xs12 md12 sm12>
|
|
<v-text-field
|
|
v-model="form.password_confirmation"
|
|
label="Confirm Password"
|
|
color="black"
|
|
:type="show2 ? 'text' : 'password'"
|
|
:append-icon="show2 ? 'visibility' : 'visibility_off'"
|
|
@click:append="show2 = !show2"
|
|
:rules="[rules.required, rules.passCounter, rules.confirm]"
|
|
></v-text-field>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-layout row wrap class="px-3">
|
|
<v-flex xs12 md6 sm6 class="text-md-left text-sm-center text-xs-center">
|
|
<v-btn
|
|
class="WM-CyanBlueGradient-BG"
|
|
style="padding:10px 60px"
|
|
@click="submitChangePassword"
|
|
>
|
|
<v-icon class="white--text mr-2 caption">fas fa-sign-in-alt</v-icon>
|
|
<span class="white--text">Submit</span>
|
|
</v-btn>
|
|
</v-flex>
|
|
</v-layout>
|
|
</material-card>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-container>
|
|
</v-form>
|
|
</template>
|
|
<script>
|
|
import { mapActions } from "vuex";
|
|
export default {
|
|
data() {
|
|
return {
|
|
show1: false,
|
|
show2: false,
|
|
rules: {
|
|
required: value => !!value || "Required.",
|
|
confirm: value => this.form.password_confirmation == this.form.password || "Your Passwords do not match.",
|
|
passCounter: value =>
|
|
(value && value.length >= 8) || "Min 8 characters"
|
|
},
|
|
form: {
|
|
password: "",
|
|
password_confirmation: ""
|
|
}
|
|
};
|
|
},
|
|
methods: {
|
|
...mapActions("auth", ["changePassword"]),
|
|
submitChangePassword() {
|
|
if (this.$refs.form.validate()) {
|
|
this.changePassword({ form: this.form });
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|