mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
Closes #10828 # Which Problems Are Solved The IDP callback flow was calling retrieveIDPIntent() twice, causing single-use token failures with error: "Intent Token is invalid". This occurred due to Next.js 15's dynamicIO feature triggering double renders # How the Problems Are Solved Completely refactored the IDP callback architecture to ensure single-use tokens are consumed exactly once: - Centralized Business Logic: Moved all IDP callback logic into a single server action (processIDPCallback) that: - Consumes the token once - Handles all 6 business scenarios (login, linking, auto-linking, auto-creation, manual registration, account not found) - Integrates session creation in the same action - Returns `{ redirect?: string; error?: string }` for client-side navigation - Client Component Invocation: Created `IdpProcessHandler` client component that: - Calls the server action from browser context (enables cookie modification) - Prevents double execution with useRef - Handles loading states and error display - Clean Architecture: - Removed 403-line success page with complex logic - Removed component files from `/components/idps/pages/` folder - Moved all UI directly into server pages - Created dedicated result pages with minimal params # Additional Changes - Added translations to all 8 supported languages --------- Co-authored-by: Ramon <[email protected]>