25 lines
718 B
TypeScript
25 lines
718 B
TypeScript
import { LoaderFunctionArgs } from "react-router";
|
|
import Page404 from "~/components/pages/Page404";
|
|
import ServerError from "~/components/ui/errors/ServerError";
|
|
import { oauthAuthorizationServerMetadata } from "~/services/mcp/oauth.server";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const url = new URL(request.url);
|
|
if (url.pathname === "/.well-known/oauth-authorization-server") {
|
|
return Response.json(oauthAuthorizationServerMetadata(), {
|
|
headers: {
|
|
"Cache-Control": "no-store",
|
|
},
|
|
});
|
|
}
|
|
return Response.json({}, { status: 404 });
|
|
};
|
|
|
|
export default function () {
|
|
return <Page404 />;
|
|
}
|
|
|
|
export function ErrorBoundary() {
|
|
return <ServerError />;
|
|
}
|