first commit
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import Button from '@/components/ui/Button.vue';
|
||||
import Input from '@/components/ui/Input.vue';
|
||||
import PasswordInput from '@/components/ui/PasswordInput.vue';
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
|
||||
const props = defineProps<{ token: string; email?: string | null }>();
|
||||
|
||||
const { __ } = useTranslations();
|
||||
|
||||
const form = useForm({
|
||||
token: props.token,
|
||||
email: props.email ?? '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post(route('password.update'), {
|
||||
onFinish: () => form.reset('password', 'password_confirmation'),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Reset Password')">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mt-2 mb-2 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase">
|
||||
{{ __('Reset Your Password') }}
|
||||
</h5>
|
||||
|
||||
<form class="space-y-4 p-2" autocomplete="off" @submit.prevent="submit">
|
||||
<p class="mb-4 px-2 text-center font-light text-slate-500">
|
||||
{{ __('Please provide your email and pick a new password below.') }}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label for="email" class="sr-only">{{ __('Your E-Mail') }}</label>
|
||||
<Input
|
||||
id="email"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
class="w-full"
|
||||
:placeholder="__('Your E-Mail')"
|
||||
:invalid="Boolean(form.errors.email)"
|
||||
autocomplete="email"
|
||||
/>
|
||||
<small v-if="form.errors.email" class="text-red-600">{{ form.errors.email }}</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password" class="sr-only">{{ __('New Password') }}</label>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
v-model="form.password"
|
||||
class="w-full"
|
||||
:placeholder="__('New Password')"
|
||||
:invalid="Boolean(form.errors.password)"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
<small v-if="form.errors.password" class="text-red-600">
|
||||
{{ form.errors.password }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password_confirmation" class="sr-only">
|
||||
{{ __('Confirm New Password') }}
|
||||
</label>
|
||||
<PasswordInput
|
||||
id="password_confirmation"
|
||||
v-model="form.password_confirmation"
|
||||
class="w-full"
|
||||
:placeholder="__('Confirm New Password')"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Update Password')"
|
||||
class="mt-6 w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user