fix: close login modal on auth success#143
Open
FlyM1ss wants to merge 1 commit into
Open
Conversation
closeAuthModal() was sequenced behind `await claimAgentsForUser()`, so the popup stayed up until a POST /agents/claim-account + loadAgents() round-trip settled -- while setAuthState() had already flipped the header to signed-in. Slow backend meant a lingering modal over a logged-in UI; a rejected claim meant it never auto-closed at all and painted the claim's error into the login form. Dismiss on auth success and demote the claim to a background chain. The deep-link retry stays chained behind the claim (it needs ownership or it 403s), and a claim failure no longer reaches the form's error slot. Verified with a Playwright harness: slow / rejecting / hung claims all dismiss the modal now, a genuine auth failure still shows its error, and the deep-link ordering is unchanged. Against a real backend the order inverts from AUTHENTICATED -> claim -> DISMISSED to AUTHENTICATED -> DISMISSED -> claim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The login popup stayed open after a successful sign-in — the header already showed you as logged in, and you had to click the backdrop to dismiss it.
closeAuthModal()was sequenced behindawait claimAgentsForUser()(app.js:1807), so dismissal waited on aclaim-accountPOST +loadAgents().setAuthState()had already signed the user in one line earlier. A slow backend left the modal up; a rejected claim meant it never auto-closed and rendered the claim's error inside the login form.Now: dismiss on auth success, claim runs in the background. The deep-link retry stays chained behind the claim (it needs ownership or it 403s), and a claim failure
console.warns instead of reaching the form's error slot — thecatchthere now means "authentication failed" and nothing else.Verified with a Playwright harness (slow / rejecting / hung claim all dismiss; genuine auth failure still errors; deep-link order unchanged). Against a real backend the sequence inverts from
AUTHENTICATED → claim → DISMISSEDtoAUTHENTICATED → DISMISSED → claim.Not covered by CI: there's no JS test framework for
dashboard/frontend.🤖 Generated with Claude Code