Add authenticated login and SSO protection
This commit is contained in:
1 parent
e36f28a668
commit
0648874801
50 files changed
+1853
-63
No files matched your search
@@ -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
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user