'use client'; import { useState } from 'react'; import { getBrowserSupabase } from '@/lib/supabase'; import Wordmark from '@/components/Wordmark'; export default function ForgotPasswordPage() { const [email, setEmail] = useState(''); const [busy, setBusy] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const request = async (e?: React.FormEvent) => { e?.preventDefault(); setError(''); if (!email) return setError('Enter your email.'); setBusy(true); const supabase = getBrowserSupabase(); if (!supabase) { setBusy(false); return setError('Auth is not configured.'); } const { error: err } = await supabase.auth.resetPasswordForEmail(email, { redirectTo: `${window.location.origin}/auth/callback?next=/profile`, }); setBusy(false); if (err) return setError(err.message); setSent(true); }; return (
{!sent ? ( <>

Reset your password

Enter your email. We'll send you a reset link.

setEmail(e.target.value)} />
{error &&

{error}

}
) : ( )}

← Back to sign in

); } function ConfirmationBlock({ email, onResend, busy }: { email: string; onResend: () => void; busy: boolean }) { return (

Check your inbox

We sent a reset link to {email}. It expires in 1 hour.

); } function EnvelopeIcon() { return ( ); }