Skip to content

fix(dashboard): reset credential modals on close so reopened forms start empty - #4027

Open
hamedniroomand wants to merge 1 commit into
decolua:masterfrom
hamedniroomand:fix/dashboard-modal-reset-on-close
Open

hamedniroomand wants to merge 1 commit into
decolua:masterfrom
hamedniroomand:fix/dashboard-modal-reset-on-close

Conversation

@hamedniroomand

Copy link
Copy Markdown

Fixes #4026

The provider page keeps AddApiKeyModal mounted and only toggles isOpen, so its form state survived every close. After saving a Gemini key, the next Add dialog showed the previous values.

Follows the existing reset-on-close convention (iFlow, GitLab, bulk importers): each modal owns a handleClose that clears its state and calls the parent onClose, wired to the Modal close prop, Cancel, and the success path.

  • AddApiKeyModal + providers/[id]/page.js: parent save handler returns true on success and no longer toggles the open flag; the modal resets and closes itself.
  • ConnectionsCard (media providers add-key modal): same.
  • AddCompatibleModal: also resets on Cancel; clears the optional Model ID check field.
  • KiroAuthModal: clears credentials and returns to the method picker on close and after import.
  • KiroOAuthWrapper: treat import-cli-proxy as a completed import like import and api-key, otherwise the modal never closed.
  • CursorAuthModal: clears pasted tokens on close and after import.

No behaviour change for failed saves: the modal stays open with the error and the input intact.

Test: add a key on any API-key provider, reopen the dialog, confirm it is empty. Cancel then reopen, also empty. Kiro CLIProxyAPI JSON import now closes the modal and refreshes connections.

bloodf pushed a commit to bloodf/durindoor that referenced this pull request Sep 17, 2026
…oses

The Cursor and Kiro auth modals kept their token, API-key and CLI-proxy-JSON
fields in component state with no reset. Cancelling left the secret populated,
and it was still rendered in the form the next time the modal was opened —
visible to anyone who reopens it, and carried into an unrelated connection
attempt.

Both now clear on close, following the isOpen-transition pattern the provider
Add-API-key modal already uses.

Scope differs from upstream: AddApiKeyModal, AddCompatibleModal and
ConnectionsCard were already fixed in this fork (#6499,
buildAddApiKeyModalReset) and are deliberately untouched — that implementation
resets only on closed→open, so a background refetch while the modal is open does
not wipe what the user has typed. Upstream's handleClose approach is strictly
weaker there.

Upstream: decolua/9router#4027
bloodf pushed a commit to bloodf/durindoor that referenced this pull request Sep 17, 2026
…oses

The Cursor and Kiro auth modals kept their token, API-key and CLI-proxy-JSON
fields in component state with no reset. Cancelling left the secret populated,
and it was still rendered in the form the next time the modal was opened —
visible to anyone who reopens it, and carried into an unrelated connection
attempt.

Both now clear on close, following the isOpen-transition pattern the provider
Add-API-key modal already uses.

Scope differs from upstream: AddApiKeyModal, AddCompatibleModal and
ConnectionsCard were already fixed in this fork (#6499,
buildAddApiKeyModalReset) and are deliberately untouched — that implementation
resets only on closed→open, so a background refetch while the modal is open does
not wipe what the user has typed. Upstream's handleClose approach is strictly
weaker there.

Upstream: decolua/9router#4027
bloodf added a commit to bloodf/durindoor that referenced this pull request Sep 17, 2026
…oses (#887)

The Cursor and Kiro auth modals kept their token, API-key and CLI-proxy-JSON
fields in component state with no reset. Cancelling left the secret populated,
and it was still rendered in the form the next time the modal was opened —
visible to anyone who reopens it, and carried into an unrelated connection
attempt.

Both now clear on close, following the isOpen-transition pattern the provider
Add-API-key modal already uses.

Scope differs from upstream: AddApiKeyModal, AddCompatibleModal and
ConnectionsCard were already fixed in this fork (#6499,
buildAddApiKeyModalReset) and are deliberately untouched — that implementation
resets only on closed→open, so a background refetch while the modal is open does
not wipe what the user has typed. Upstream's handleClose approach is strictly
weaker there.

Upstream: decolua/9router#4027

Co-authored-by: durindoor-bot <bot@durindoor.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API Key dialog keeps previous values after saving or cancelling

1 participant