mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-09 13:06:45 +03:00
updates
This commit is contained in:
22
src/pages/api/sso/providers/public.ts
Normal file
22
src/pages/api/sso/providers/public.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { APIContext } from "astro";
|
||||
import { createSecureErrorResponse } from "@/lib/utils";
|
||||
import { db, ssoProviders } from "@/lib/db";
|
||||
|
||||
// GET /api/sso/providers/public - Get public SSO provider information for login page
|
||||
export async function GET(context: APIContext) {
|
||||
try {
|
||||
// Get all providers but only return public information
|
||||
const providers = await db.select({
|
||||
id: ssoProviders.id,
|
||||
providerId: ssoProviders.providerId,
|
||||
domain: ssoProviders.domain,
|
||||
}).from(ssoProviders);
|
||||
|
||||
return new Response(JSON.stringify(providers), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
} catch (error) {
|
||||
return createSecureErrorResponse(error, "Public SSO providers API");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user