mongoku
Version:
[](https://github.com/huggingface/Mongoku/actions/workflows/ci.yml)
35 lines (32 loc) • 1.02 kB
JavaScript
import { b as base } from './server-Crjo4w1q.js';
import './root-otUAnOAR.js';
import { g as getOAuthConfig, O as OAUTH_CIMD_CLIENT_ID, a as getCallbackUrl } from './oauth-D6jTWKFd.js';
import './async-DUoD1OpG.js';
import './shared-server-BmU87nph.js';
import 'node:crypto';
const GET = async ({ url }) => {
const config = await getOAuthConfig();
if (!config) {
return new Response("OAuth is not configured", { status: 404 });
}
if (config.clientId !== OAUTH_CIMD_CLIENT_ID) {
return new Response("CIMD is disabled", { status: 404 });
}
return new Response(
JSON.stringify({
client_id: new URL(url.pathname, url.origin).toString(),
client_name: "Mongoku",
client_uri: `${url.origin}${base}`,
redirect_uris: [getCallbackUrl(url.origin)],
token_endpoint_auth_method: "none",
scope: config.scopes
}),
{
headers: {
"Content-Type": "application/json"
}
}
);
};
export { GET };
//# sourceMappingURL=_server.ts-i-glbZtX.js.map