mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-30 07:58:51 +00:00
feat(login): redirect configuration options in multi-domain setups (#11527)
# Which Problems Are Solved This PR introduces robust redirect configuration options and enhances security for Server Actions in multi-domain setups. # How the Problems Are Solved - Redirect Fallback Logic: Implemented a unified `resolveRedirectUri` utility that prioritizes redirect targets as follows: - Environment override (`DEFAULT_REDIRECT_URI`) - Organization settings (`defaultRedirectUri`). - Relative fallback (`/signedin?...`). - Host Reflection: `DEFAULT_REDIRECT_URI` supports absolute URLs or relative paths via host reflection. - Server Action Security: Configured `serverActions.allowedOrigins` to be dynamically manageable via the `SERVER_ACTION_ALLOWED_ORIGINS` environment variable (comma-separated list). It defaults to an empty list for maximum security. - UI Integration: Updated the /signedin page to use the unified redirect logic, ensuring consistent behavior for the "Continue" button. - Documentation: Added type definitions and detailed descriptions for new environment variables in `next-env-vars.d.ts` --------- Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -34,9 +34,15 @@ const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
experimental: {
|
||||
// Add React 19 compatibility optimizations
|
||||
optimizePackageImports: ['@radix-ui/react-tooltip', '@heroicons/react'],
|
||||
optimizePackageImports: ["@radix-ui/react-tooltip", "@heroicons/react"],
|
||||
useCache: true,
|
||||
serverActions: {
|
||||
...(process.env.SERVER_ACTION_ALLOWED_ORIGINS
|
||||
? { allowedOrigins: process.env.SERVER_ACTION_ALLOWED_ORIGINS.split(",").map((o) => o.trim()) }
|
||||
: {}),
|
||||
},
|
||||
},
|
||||
|
||||
// Improve SSR stability - not actually needed for React 19 SSR issues
|
||||
// onDemandEntries: {
|
||||
// maxInactiveAge: 25 * 1000,
|
||||
|
||||
Reference in New Issue
Block a user