Files
roxane/resources/js/pages/auth/forgot-password.tsx

70 lines
2.8 KiB
TypeScript
Raw Normal View History

2025-10-22 17:09:48 +02:00
// Components
import PasswordResetLinkController from '@/actions/App/Http/Controllers/Auth/PasswordResetLinkController';
import { login } from '@/routes';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';
import InputError from '@/components/input-error';
import TextLink from '@/components/text-link';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import AuthLayout from '@/layouts/auth-layout';
export default function ForgotPassword({ status }: { status?: string }) {
return (
<AuthLayout
title="Mot de passe oublié"
description="Entrez votre adresse mail pour recevoir le lien de réinitialisation de mot de passe"
2025-10-22 17:09:48 +02:00
>
<Head title="Mot de passe oublié" />
2025-10-22 17:09:48 +02:00
{status && (
<div className="mb-4 text-center text-sm font-medium text-green-600">
{status}
</div>
)}
<div className="space-y-6">
<Form {...PasswordResetLinkController.store.form()}>
{({ processing, errors }) => (
<>
<div className="grid gap-2">
<Label htmlFor="email">Adresse Mail</Label>
2025-10-22 17:09:48 +02:00
<Input
id="email"
type="email"
name="email"
autoComplete="off"
autoFocus
placeholder="email@exemple.com"
2025-10-22 17:09:48 +02:00
/>
<InputError message={errors.email} />
</div>
<div className="my-6 flex items-center justify-start">
<Button
className="w-full"
disabled={processing}
data-test="email-password-reset-link-button"
>
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
Envoyer le mail de réinitialisation
2025-10-22 17:09:48 +02:00
</Button>
</div>
</>
)}
</Form>
<div className="space-x-1 text-center text-sm text-muted-foreground">
<span>Ou, retourner à la page</span>
<TextLink href={login()}>Se connecter</TextLink>
2025-10-22 17:09:48 +02:00
</div>
</div>
</AuthLayout>
);
}