/** * Forgot Password Page * * Request password reset */ 'use client'; import { useState } from 'react'; import { authApi } from '@/lib/api'; import Link from 'next/link'; export default function ForgotPasswordPage() { const [email, setEmail] = useState(''); const [success, setSuccess] = useState(false); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setLoading(true); try { await authApi.forgotPassword(email); setSuccess(true); } catch (err: any) { setError(err.response?.data?.message || 'Failed to send reset email. Please try again.'); } finally { setLoading(false); } }; if (success) { return (

Xpeditis

Check your email

We've sent a password reset link to {email}. Please check your inbox and follow the instructions.
Back to sign in
); } return (

Xpeditis

Reset your password

Enter your email address and we'll send you a link to reset your password.

{error && (
{error}
)}
setEmail(e.target.value)} className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" placeholder="Email address" />
Back to sign in
); }