Merged
Size
S
Change Breakdown
Bug Fix75%
Maintenance25%
#28388fix(editor): Reset OIDC form dirty state after saving IdP settings

False 'Unsaved changes' warning fixed for OIDC settings

Saving OIDC IdP settings no longer triggers a false "Unsaved changes" warning when navigating away. The fix ensures the app properly syncs configuration state after saves.

A subtle state synchronization bug was causing confusion in the SSO settings flow. After saving OIDC identity provider settings, the application would incorrectly detect "unsaved changes" whenever a user tried to navigate away — even though everything was already saved. Users had to save twice before the warning disappeared.

The root cause was straightforward: the function was fetching the latest configuration from the server but not updating the local loginEnabled flag in the OIDC state object. The dirty check compared this stale startup value against the fresh server response, seeing a mismatch where none existed.

Three related fixes resolved the issue. First, the SSO store now properly syncs loginEnabled whenever configuration is fetched. Second, both the and handlers were refactored to return boolean values indicating success or failure. Third, the guard was updated to only proceed with navigation if the save operation completed successfully.

The same pattern was applied to SAML settings for consistency, ensuring the two authentication methods behave identically.

View Original GitHub Description

Summary

After saving OIDC IdP settings, navigating away falsely triggered the "Unsaved changes" modal. The OIDC store's getOidcConfig() was not syncing oidc.loginEnabled (unlike the SAML equivalent), causing the dirty check to see a mismatch between the fresh server config and the stale app-startup value.

How to verify

  1. Go to Settings → SSO and select OIDC
  2. Fill in a discovery endpoint, client ID, and client secret
  3. Click Save
  4. Click the Settings back button in the top nav
  5. Expected: No "Unsaved changes" modal appears
  6. Now make a change to any field (e.g. client ID) without saving
  7. Click the Settings back button
  8. Expected: "Unsaved changes" modal appears
  9. Save, then make another change without saving, then navigate away
  10. Expected: "Unsaved changes" modal appears

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/IAM-536

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse