mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-10 05:26:44 +03:00
Added Header Authentication
This commit is contained in:
16
src/pages/api/auth/header-status.ts
Normal file
16
src/pages/api/auth/header-status.ts
Normal 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" },
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user