import { n as getPublicOrigin } from "../../../../public-url-Danv47cS.mjs";
import { n as VALID_SCOPES } from "../../../../api-tokens-DsvvCtdh.mjs";

//#region src/astro/routes/api/well-known/oauth-authorization-server.ts
const prerender = false;
const GET = async ({ url, locals }) => {
	const origin = getPublicOrigin(url, locals.emdash?.config);
	const issuer = `${origin}/_emdash`;
	return Response.json({
		issuer,
		authorization_endpoint: `${origin}/_emdash/oauth/authorize`,
		token_endpoint: `${origin}/_emdash/api/oauth/token`,
		scopes_supported: [...VALID_SCOPES],
		response_types_supported: ["code"],
		grant_types_supported: [
			"authorization_code",
			"refresh_token",
			"urn:ietf:params:oauth:grant-type:device_code"
		],
		code_challenge_methods_supported: ["S256"],
		registration_endpoint: `${origin}/_emdash/api/oauth/register`,
		token_endpoint_auth_methods_supported: ["none"],
		device_authorization_endpoint: `${origin}/_emdash/api/oauth/device/code`
	}, { headers: {
		"Cache-Control": "public, max-age=3600",
		"Access-Control-Allow-Origin": "*"
	} });
};

//#endregion
export { GET, prerender };
//# sourceMappingURL=oauth-authorization-server.mjs.map