Files
calendar/apps/web/app/not-found.tsx
T
Hariom BalharaandGitHub f905ae7502 fix: Add CSP back to login page (#22688)
* Middleware only logic to add CSP header as Next.js App Router doesnt allow setting header in server component

* add tests

* Remove nonce from Page Router and fix ts issues

* Add checkly test
2025-07-26 01:38:20 +01:00

34 lines
772 B
TypeScript

import { _generateMetadata } from "app/_utils";
import { headers } from "next/headers";
import PageWrapper from "@components/PageWrapperAppDir";
import { NotFound } from "./notFoundClient";
export const generateMetadata = async () => {
const metadata = await _generateMetadata(
(t) => t("404_page_not_found"),
(t) => t("404_page_not_found")
);
return {
...metadata,
robots: {
index: false,
follow: false,
},
};
};
const ServerPage = async () => {
const h = await headers();
const nonce = h.get("x-csp-nonce") ?? undefined;
const host = h.get("x-forwarded-host") ?? "";
return (
<PageWrapper requiresLicense={false} nonce={nonce}>
<NotFound host={host} />
</PageWrapper>
);
};
export default ServerPage;