Add authenticated login and SSO protection

This commit is contained in:
inman
2026-05-29 15:54:13 +08:00
parent e36f28a668
commit 0648874801
50 changed files with 1853 additions and 63 deletions

16
app/api/auth/me/route.ts Normal file
View File

@@ -0,0 +1,16 @@
import { getAuthRuntimeConfig } from "@/lib/auth/config";
import { jsonOk } from "@/lib/server/api";
import { getOptionalAuthSession } from "@/lib/server/auth/current-user";
export const runtime = "nodejs";
export async function GET() {
const config = getAuthRuntimeConfig();
const session = await getOptionalAuthSession();
return jsonOk({
authenticated: Boolean(session),
authRequired: config.required,
authConfigured: config.configured,
user: session?.user || null
});
}