Skip to content

fix(fe): Reset identity popover state on authentication failure#3722

Merged
sea-snake merged 2 commits intomainfrom
sea-snake/fix-identity-popover-cancel
Apr 2, 2026
Merged

fix(fe): Reset identity popover state on authentication failure#3722
sea-snake merged 2 commits intomainfrom
sea-snake/fix-identity-popover-cancel

Conversation

@sea-snake
Copy link
Copy Markdown
Contributor

When switching identities via the identity popover, if authentication fails
(e.g. the user cancels the passkey prompt), the popover and dialog state
(isIdentityPopoverOpen, isAuthDialogOpen, isAuthenticating) are never
reset. This leaves the UI in a broken state where the popover cannot be closed by clicking outside it.

Changes

  • Wrap handleSignIn in try/finally blocks across three routes so that
    popover/dialog state is always cleaned up, even when authentication throws:
    • (channel)/authorize/+layout.svelte
    • +page.svelte
    • manage/(authenticated)/+layout.svelte

@sea-snake sea-snake requested a review from a team as a code owner March 31, 2026 10:48
@sea-snake sea-snake requested a review from aterga March 31, 2026 10:49
@aterga aterga requested a review from Copilot April 1, 2026 08:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures the identity switcher UI doesn’t get stuck in an “authenticating” state when authentication is cancelled or otherwise fails, by guaranteeing popover/dialog state cleanup even when authenticate(...) throws.

Changes:

  • Wrapped handleSignIn in try/finally so isIdentityPopoverOpen, isAuthDialogOpen, and isAuthenticating are always reset.
  • Applied the same cleanup pattern across the landing page, authorize layout, and manage authenticated layout.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/frontend/src/routes/(new-styling)/manage/(authenticated)/+layout.svelte Ensures identity popover/auth dialog state is reset even if sign-in throws during identity switching.
src/frontend/src/routes/(new-styling)/+page.svelte Adds try/finally cleanup around sign-in/navigation so the landing page identity switch UI can’t get stuck.
src/frontend/src/routes/(new-styling)/(channel)/authorize/+layout.svelte Ensures authorize flow identity switching resets UI state on authentication failure/cancellation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/routes/(new-styling)/+page.svelte
@sea-snake sea-snake added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit aebef7c Apr 2, 2026
46 checks passed
@sea-snake sea-snake deleted the sea-snake/fix-identity-popover-cancel branch April 2, 2026 16:18
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.

3 participants