diff --git a/src/app/api/session/route.ts b/src/app/api/session/route.ts index 7b101d8..d19fb22 100644 --- a/src/app/api/session/route.ts +++ b/src/app/api/session/route.ts @@ -1,13 +1,14 @@ import { NextResponse, type NextRequest } from "next/server"; import { loginToMinnect, LoginError } from "@/lib/minnect"; import { createSession, getSession } from "@/lib/session-store"; -import { endSession } from "@/lib/session-refresh"; import { SESSION_COOKIE, sessionCookieOptions } from "@/lib/cookie"; // This route holds the session on the server. The browser talks only to this // app; Minnect tokens never leave the server (ADR-001). // -// POST signs in, GET says who the person is, DELETE signs out (revoke + clear). +// POST signs in, GET says who the person is. There is no sign-out: the session ends +// when the server restarts or the cookie is cleared, and Minnect's revoke endpoint +// is never called (the refresh token is shared across the person's devices). // The reusable token-refresh logic lives in session-refresh.ts for the feed // route (a later task) to call before it uses a token. @@ -91,21 +92,3 @@ export async function GET(req: NextRequest) { feedUserId: session.person.feedUserId ?? null, }); } - -/** - * DELETE /api/session - * Sign out: revoke the refresh token at Minnect (best-effort), delete the - * server session, and clear the cookie. Always returns 200: sign-out succeeds - * even when revoke errors. After this, the session is gone, so every - * token-requiring route (and GET /api/session) returns 401 { error: "sign_in" }. - */ -export async function DELETE(req: NextRequest) { - const sessionId = req.cookies.get(SESSION_COOKIE)?.value; - - await endSession(sessionId); - - const res = NextResponse.json({ ok: true }); - // Expire the cookie with the same attributes it was set with. - res.cookies.set(SESSION_COOKIE, "", { ...sessionCookieOptions(), maxAge: 0 }); - return res; -} diff --git a/src/components/App.tsx b/src/components/App.tsx index 2c0a05f..166ef65 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useState } from "react"; -import { loadSession, signOut, type Person } from "@/lib/auth-client"; +import { loadSession, type Person } from "@/lib/auth-client"; import { SignInForm } from "./SignInForm"; import { Logo } from "./Logo"; import { Feed } from "./Feed"; @@ -10,7 +10,6 @@ type State = { kind: "loading" } | { kind: "out" } | { kind: "in"; person: Perso export function App() { const [state, setState] = useState({ kind: "loading" }); - const [signingOut, setSigningOut] = useState(false); useEffect(() => { let live = true; @@ -22,14 +21,6 @@ export function App() { }; }, []); - async function handleSignOut() { - if (signingOut) return; - setSigningOut(true); - await signOut(); - setSigningOut(false); - setState({ kind: "out" }); - } - if (state.kind === "loading") { return (
@@ -54,9 +45,6 @@ export function App() { {state.person.name} {state.person.email} - setState({ kind: "out" })} />
diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index be96a78..dfb5f63 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -9,9 +9,12 @@ export interface VideoPlayerProps { label: string; } +const UNPLAYABLE = "Video can't be played here."; + /** - * Real