2022-10-08 17:54:43 +00:00
|
|
|
const { i18n } = require('./next-i18next.config');
|
|
|
|
|
2022-01-05 12:09:51 +00:00
|
|
|
/** @type {import('next').NextConfig} */
|
2022-02-16 01:39:38 +00:00
|
|
|
|
2022-01-05 12:09:51 +00:00
|
|
|
module.exports = {
|
2023-10-28 23:34:56 +00:00
|
|
|
experimental: { esmExternals: false, webpackBuildWorker: true },
|
2022-11-24 21:27:02 +00:00
|
|
|
productionBrowserSourceMaps: true,
|
2022-01-05 12:09:51 +00:00
|
|
|
reactStrictMode: true,
|
2022-10-08 17:54:43 +00:00
|
|
|
i18n,
|
2022-10-08 17:23:27 +00:00
|
|
|
output: 'standalone',
|
2024-02-01 17:28:29 +00:00
|
|
|
webpack: (config, { dev, webpack, isServer }) => {
|
|
|
|
// Enable source maps in development mode and for server-side rendering
|
|
|
|
if (!dev && isServer) {
|
|
|
|
config.devtool = 'source-map';
|
|
|
|
}
|
|
|
|
|
2022-02-16 01:39:38 +00:00
|
|
|
if (isServer) {
|
|
|
|
// Module not found
|
|
|
|
config.plugins.push(
|
|
|
|
new webpack.IgnorePlugin({
|
|
|
|
resourceRegExp:
|
2024-01-11 14:25:09 +00:00
|
|
|
/(^@google-cloud\/spanner|^@mongodb-js\/zstd|^aws-crt|^aws4$|^pg-native$|^mongodb-client-encryption$|^@sap\/hana-client$|^@sap\/hana-client\/extension\/Stream$|^snappy$|^react-native-sqlite-storage$|^bson-ext$|^cardinal$|^kerberos$|^hdb-pool$|^sql.js$|^sqlite3$|^better-sqlite3$|^ioredis$|^typeorm-aurora-data-api-driver$|^pg-query-stream$|^oracledb$|^mysql$|^snappy\/package\.json$|^cloudflare:sockets$)/,
|
2022-02-16 01:39:38 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-11-05 00:05:42 +00:00
|
|
|
config.module = {
|
|
|
|
...config.module,
|
|
|
|
exprContextCritical: false,
|
|
|
|
};
|
|
|
|
|
2022-02-16 01:39:38 +00:00
|
|
|
return config;
|
|
|
|
},
|
2022-07-23 17:04:55 +00:00
|
|
|
rewrites: async () => {
|
|
|
|
return [
|
2022-11-10 21:38:06 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/saml.cer',
|
|
|
|
destination: '/api/well-known/saml.cer',
|
|
|
|
},
|
2022-07-23 17:04:55 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/openid-configuration',
|
|
|
|
destination: '/api/well-known/openid-configuration',
|
|
|
|
},
|
2023-12-13 18:23:37 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/oidc-configuration',
|
|
|
|
destination: '/well-known/oidc-configuration',
|
|
|
|
},
|
2022-10-28 19:19:31 +00:00
|
|
|
{
|
2022-10-29 13:21:30 +00:00
|
|
|
source: '/.well-known/sp-metadata',
|
|
|
|
destination: '/api/well-known/sp-metadata',
|
2022-10-28 19:19:31 +00:00
|
|
|
},
|
2022-12-18 21:13:12 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/idp-metadata',
|
|
|
|
destination: '/api/well-known/idp-metadata',
|
|
|
|
},
|
2022-09-07 14:20:06 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/saml-configuration',
|
|
|
|
destination: '/well-known/saml-configuration',
|
|
|
|
},
|
2022-12-18 21:13:12 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known/idp-configuration',
|
|
|
|
destination: '/well-known/idp-configuration',
|
|
|
|
},
|
2022-07-23 17:04:55 +00:00
|
|
|
{
|
|
|
|
source: '/oauth/jwks',
|
|
|
|
destination: '/api/oauth/jwks',
|
|
|
|
},
|
2022-12-13 21:41:27 +00:00
|
|
|
{
|
|
|
|
source: '/admin/directory-sync/setup-link',
|
2022-12-30 13:43:50 +00:00
|
|
|
destination: '/admin/setup-link',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/admin/sso-connection/setup-link',
|
|
|
|
destination: '/admin/setup-link',
|
2022-12-13 21:41:27 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/admin/sso-connection/setup-link/new',
|
|
|
|
destination: '/admin/setup-link/new',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/admin/directory-sync/setup-link/new',
|
|
|
|
destination: '/admin/setup-link/new',
|
|
|
|
},
|
2022-12-23 22:43:04 +00:00
|
|
|
{
|
|
|
|
source: '/.well-known',
|
|
|
|
destination: '/well-known',
|
|
|
|
},
|
2023-01-12 15:09:08 +00:00
|
|
|
{
|
|
|
|
source: '/admin/settings',
|
|
|
|
destination: '/admin/settings/sso-connection',
|
|
|
|
},
|
2023-07-31 17:19:27 +00:00
|
|
|
{
|
|
|
|
source: '/api/v1/connections/:path*',
|
|
|
|
destination: '/api/v1/sso/:path*',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/api/v1/directory-sync/:path*',
|
|
|
|
destination: '/api/v1/dsync/:path*',
|
|
|
|
},
|
2024-01-23 22:35:17 +00:00
|
|
|
{
|
|
|
|
source: '/api/v1/saml-traces/:path*',
|
|
|
|
destination: '/api/v1/sso-traces/:path*',
|
|
|
|
},
|
2024-05-10 10:41:23 +00:00
|
|
|
{
|
|
|
|
source: '/api/v1/federated-saml/:path*',
|
|
|
|
destination: '/api/v1/identity-federation/:path*',
|
|
|
|
},
|
2022-07-23 17:04:55 +00:00
|
|
|
];
|
|
|
|
},
|
2023-03-09 14:50:25 +00:00
|
|
|
images: {
|
|
|
|
remotePatterns: [
|
|
|
|
{
|
|
|
|
protocol: 'https',
|
|
|
|
hostname: '*',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2023-11-18 21:30:29 +00:00
|
|
|
async headers() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: '/(.*?)',
|
|
|
|
headers: [
|
|
|
|
{
|
|
|
|
key: 'Strict-Transport-Security',
|
|
|
|
value: 'max-age=31536000; includeSubDomains;',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'X-Frame-Options',
|
|
|
|
value: 'SAMEORIGIN',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'X-Content-Type-Options',
|
|
|
|
value: 'nosniff',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2022-02-16 01:39:38 +00:00
|
|
|
};
|