"use client"; import { Suspense, useState } from "react"; import Link from "next/link"; import Header from "@/components/Header"; import Footer from "@/components/Footer"; import { createClient } from "@/lib/supabase/client"; function ForgotInner() { const supabase = createClient(); const [email, setEmail] = useState(""); const [busy, setBusy] = useState(false); const [msg, setMsg] = useState(null); const [err, setErr] = useState(null); async function submit(e: React.FormEvent) { e.preventDefault(); setBusy(true); setMsg(null); setErr(null); const { error } = await supabase.auth.resetPasswordForEmail(email.trim(), { redirectTo: `${window.location.origin}/forum/reset-password`, }); setBusy(false); if (error) { setErr(error.message); } else { setMsg("Check your inbox — we sent a password reset link. If you didn't have an account, no email is sent."); } } return ( <>
Account recovery

Reset your password

Enter your email — we’ll send a link to set a new password.

{err && (
{err}
)} {msg && (
{msg}
)}
setEmail(e.target.value)} autoComplete="email" required className="w-full bg-[#0d0d0d] border border-[#2a2a2a] rounded-lg px-3 py-2 text-white font-body text-sm focus:outline-none focus:border-[#ffb800]" />
Remembered it?{" "} Back to sign in