opnform/resources/js/pages/settings/password.vue

54 lines
1.2 KiB
Vue
Raw Normal View History

2022-09-20 19:59:52 +00:00
<template>
<div>
2023-10-14 16:24:44 +00:00
<h3 class="font-semibold text-2xl text-gray-900">
Password
</h3>
<small class="text-gray-600">Manage your password.</small>
2023-10-14 16:24:44 +00:00
<form class="mt-3" @submit.prevent="update" @keydown="form.onKeydown($event)">
<alert-success class="mb-5" :form="form" message="Password updated." />
2022-09-20 19:59:52 +00:00
<!-- Password -->
<text-input native-type="password"
2023-10-14 16:24:44 +00:00
name="password" :form="form" label="Password" :required="true"
2022-09-20 19:59:52 +00:00
/>
<!-- Password Confirmation-->
<text-input native-type="password"
2023-10-14 16:24:44 +00:00
name="password_confirmation" :form="form" label="Confirm Password" :required="true"
2022-09-20 19:59:52 +00:00
/>
<!-- Submit Button -->
2023-10-14 16:24:44 +00:00
<v-button :loading="form.busy" class="mt-4">
Update password
</v-button>
2022-09-20 19:59:52 +00:00
</form>
</div>
2022-09-20 19:59:52 +00:00
</template>
<script>
import Form from 'vform'
import SeoMeta from '../../mixins/seo-meta.js'
2022-09-20 19:59:52 +00:00
export default {
mixins: [SeoMeta],
2023-10-14 16:24:44 +00:00
scrollToTop: false,
2022-09-20 19:59:52 +00:00
data: () => ({
metaTitle: 'Password',
2022-09-20 19:59:52 +00:00
form: new Form({
password: '',
password_confirmation: ''
})
}),
methods: {
async update () {
await this.form.patch('/api/settings/password')
this.form.reset()
}
}
}
</script>