From 8cc1c3b6340182cd3d56bc410b6c2a1ec58123b2 Mon Sep 17 00:00:00 2001 From: glass beadian Date: Tue, 13 Oct 2026 13:18:23 +0000 Subject: [PATCH] Login: drop AuthProvider dependency so /login exports statically --- apps/web/src/app/login/page.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/login/page.tsx b/apps/web/src/app/login/page.tsx index 2023d24..fd007e3 100644 --- a/apps/web/src/app/login/page.tsx +++ b/apps/web/src/app/login/page.tsx @@ -4,14 +4,14 @@ import { useState, type FormEvent } from "react"; import Link from "next/link"; import { Button, Card, Input } from "../../components/ui/primitives"; import { api, errorMessage } from "../../lib/api-client"; -import { useAuth } from "../../lib/auth-store"; +import { setSessionToken } from "../../lib/session-token"; +import type { AuthResult } from "../../lib/api-types"; /** * /login — bare sign-in: username and password, nothing else. Account creation * lives at /signup; collective joining happens with an invite link. */ export default function LoginPage(): React.ReactElement { - const { login } = useAuth(); const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); const [busy, setBusy] = useState(false); @@ -22,7 +22,12 @@ export default function LoginPage(): React.ReactElement { setBusy(true); setError(null); try { - await api.post("/auth/login", { username: username.trim(), password }, { redirectOn401: false }); + const result = await api.post( + "/auth/login", + { username: username.trim(), password }, + { redirectOn401: false }, + ); + setSessionToken(result.token); window.location.assign("/streams"); } catch (err) { setError(errorMessage(err));