import { useState } from 'react' import { Link } from 'react-router-dom' import { authApi } from '@/api/auth' import { BrandLogo } from '@/components/common/BrandLogo' import { PageMeta } from '@/components/common/PageMeta' import { cn } from '@/lib/utils' export function ForgotPasswordPage() { const [email, setEmail] = useState('') const [isLoading, setIsLoading] = useState(false) const [submitted, setSubmitted] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (!email) return setIsLoading(true) try { await authApi.forgotPassword(email) } catch { // Always show success (anti-enumeration) } finally { setIsLoading(false) setSubmitted(true) } } return ( <>

Reset Password

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

{submitted ? (
If an account with that email exists, we've sent a password reset link. Check your inbox and follow the instructions.
Back to sign in
) : (
setEmail(e.target.value)} className={cn( 'block w-full rounded-xl border border-border bg-card px-3 py-2', 'text-foreground placeholder:text-muted-foreground', 'focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20', 'transition-colors' )} placeholder="you@example.com" />
Back to sign in
)}
) } export default ForgotPasswordPage