From 742010a9a9391f21379c7703cb940fcfbe86e3c3 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 1 Sep 2026 02:11:28 +0200 Subject: [PATCH] chore(login): simplify to login-only, remove register/reset tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /login page previously had three tabs (Login / Register / Reset Password) wired through useAuth(). The Register and Reset handlers were removed in this pass — only the Login form remains, plus a small UI/styling cleanup that was collateral. - Drop Tabs imports + the active-tab state plumbing - Drop regName/regEmail/regPassword/regConfirm + resetEmail state - Drop handleRegister + handleReset handlers (login-only now) - Drop useAuth().register / useAuth().requestPasswordReset destructuring - Trim the local stylesheet comments that referenced the Base UI tabs triggers (no longer applicable) Co-Authored-By: Claude Code --- src/app/(auth)/login/page.tsx | 253 ++++++---------------------------- 1 file changed, 42 insertions(+), 211 deletions(-) diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index 6975bbb..798beca 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -7,7 +7,6 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { toast } from "sonner"; import { Loader2 } from "lucide-react"; @@ -66,20 +65,13 @@ const primaryButtonStyle = { const labelStyle = { color: BRAND.textSecondary }; export default function AuthPage() { - const { login, register, requestPasswordReset } = useAuth(); + const { login } = useAuth(); const router = useRouter(); const [loading, setLoading] = useState(false); const [loginEmail, setLoginEmail] = useState(""); const [loginPassword, setLoginPassword] = useState(""); - const [regName, setRegName] = useState(""); - const [regEmail, setRegEmail] = useState(""); - const [regPassword, setRegPassword] = useState(""); - const [regConfirm, setRegConfirm] = useState(""); - - const [resetEmail, setResetEmail] = useState(""); - const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); @@ -95,61 +87,15 @@ export default function AuthPage() { } }; - const handleRegister = async (e: React.FormEvent) => { - e.preventDefault(); - if (regPassword !== regConfirm) { - toast.error("Passwords do not match"); - return; - } - setLoading(true); - try { - await register(regEmail, regPassword, regConfirm, regName); - toast.success("Account created successfully"); - router.push("/dashboard"); - } catch (err: unknown) { - const message = err instanceof Error ? err.message : "Registration failed"; - toast.error(message); - } finally { - setLoading(false); - } - }; - - const handleReset = async (e: React.FormEvent) => { - e.preventDefault(); - setLoading(true); - try { - await requestPasswordReset(resetEmail); - toast.success("Password reset email sent"); - } catch (err: unknown) { - const message = err instanceof Error ? err.message : "Reset failed"; - toast.error(message); - } finally { - setLoading(false); - } - }; - return (
{/* === Local stylesheet — scoped to this card via the wrapper class - so they never bleed into the rest of the app. Targets the - Base UI tabs triggers (data-active toggles on the active tab) - and the input focus ring so the form reads as a single - branded surface. */} + so they never bleed into the rest of the app. Targets the input + focus ring so the form reads as a single branded surface. */}