Repository navigation
fix(dashboard): reset credential modals on close so reopened forms start empty - #4027
Open
hamedniroomand wants to merge 1 commit into
Open
hamedniroomand wants to merge 1 commit into
hamedniroomand wants to merge 1 commit into
Conversation
Merged
7 tasks done
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4026
The provider page keeps
AddApiKeyModalmounted and only togglesisOpen, 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
handleClosethat clears its state and calls the parentonClose, wired to the Modal close prop, Cancel, and the success path.AddApiKeyModal+providers/[id]/page.js: parent save handler returnstrueon 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: treatimport-cli-proxyas a completed import likeimportandapi-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.