Added Header Authentication

This commit is contained in:
Arunavo Ray
2025-07-17 16:19:56 +05:30
parent 744064f3aa
commit cad77320f3
7 changed files with 328 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
import type { APIRoute } from "astro";
import { getHeaderAuthConfig } from "@/lib/auth-header";
export const GET: APIRoute = async () => {
const config = getHeaderAuthConfig();
return new Response(JSON.stringify({
enabled: config.enabled,
userHeader: config.userHeader,
autoProvision: config.autoProvision,
hasAllowedDomains: config.allowedDomains && config.allowedDomains.length > 0,
}), {
status: 200,
headers: { "Content-Type": "application/json" },
});
};