import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Label } from '../components/ui/label'; import { Card } from '../components/ui/card'; import { toast } from 'sonner'; import PublicNavbar from '../components/PublicNavbar'; import PublicFooter from '../components/PublicFooter'; import { ArrowRight, ArrowLeft, Mail, CheckCircle } from 'lucide-react'; const ForgotPassword = () => { const { forgotPassword } = useAuth(); const [loading, setLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [email, setEmail] = useState(''); const handleSubmit = async (e) => { e.preventDefault(); setLoading(true); try { await forgotPassword(email); setSubmitted(true); toast.success('Password reset email sent!'); } catch (error) { toast.error(error.response?.data?.detail || 'Failed to send reset email. Please try again.'); } finally { setLoading(false); } }; return (
No worries! Enter your email and we'll send you reset instructions.
If an account exists for {email}, you will receive a password reset link shortly.
The link will expire in 1 hour. If you don't see the email, check your spam folder.