mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
* fix: Improve host header handling and deployment mode detection * ZITADEL_CLOUD env * refactor service config * service config * cleanup * cleanup * util for original and public host * instanceHost, publicHost * cleanup constructUrl * cleanup middleware * add x-zitadel-forward-host as fallback for current cloud setup * fix build * fix: lint * fix: update test mocks * fix: provide basepath to unit tests * host handling * unit tests * imports * fix: getPublicHost instead of getInstanceHost * unit tests * update nextjs, implement jwt verify for logout_token * pass logout information in jwt to login v2 * handle hosts in jwks url * point idp callbacks to the api and not the login UI * logout_hint out of logout token, typecheck * rm unused imports * fix oidc integration test --------- Co-authored-by: Livio Spring <[email protected]>
62 lines
1.4 KiB
JavaScript
Executable File
62 lines
1.4 KiB
JavaScript
Executable File
import createNextIntlPlugin from "next-intl/plugin";
|
|
import { DEFAULT_CSP } from "./constants/csp.js";
|
|
|
|
const withNextIntl = createNextIntlPlugin();
|
|
|
|
const secureHeaders = [
|
|
{
|
|
key: "Strict-Transport-Security",
|
|
value: "max-age=63072000; includeSubDomains; preload",
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "origin-when-cross-origin",
|
|
},
|
|
{
|
|
key: "X-Frame-Options",
|
|
value: "SAMEORIGIN",
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "X-XSS-Protection",
|
|
value: "1; mode=block",
|
|
},
|
|
{
|
|
key: "Content-Security-Policy",
|
|
value: `${DEFAULT_CSP} frame-ancestors 'none'`,
|
|
},
|
|
{ key: "X-Frame-Options", value: "deny" },
|
|
];
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
output: process.env.NEXT_OUTPUT_MODE || undefined,
|
|
reactStrictMode: true,
|
|
experimental: {
|
|
// Add React 19 compatibility optimizations
|
|
optimizePackageImports: ['@radix-ui/react-tooltip', '@heroicons/react'],
|
|
useCache: true,
|
|
},
|
|
// Improve SSR stability - not actually needed for React 19 SSR issues
|
|
// onDemandEntries: {
|
|
// maxInactiveAge: 25 * 1000,
|
|
// pagesBufferLength: 2,
|
|
// },
|
|
// Better error handling for production builds
|
|
poweredByHeader: false,
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/:path*",
|
|
headers: secureHeaders,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|