Skip to content

fix: close login modal on auth success#143

Open
FlyM1ss wants to merge 1 commit into
mainfrom
fix/auth-modal-close
Open

fix: close login modal on auth success#143
FlyM1ss wants to merge 1 commit into
mainfrom
fix/auth-modal-close

Conversation

@FlyM1ss

@FlyM1ss FlyM1ss commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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 behind await claimAgentsForUser() (app.js:1807), so dismissal waited on a claim-account POST + 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 — the catch there 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 → DISMISSED to AUTHENTICATED → DISMISSED → claim.

Not covered by CI: there's no JS test framework for dashboard/frontend.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentic-trading-lab Ready Ready Preview, Comment Jul 17, 2026 1:42pm

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.

1 participant