Skip to content

Preserve org invitations when switching signed-in accounts - #615

Merged
wileymc merged 1 commit into
mainfrom
w/invite-account-switch
Sep 22, 2026
Merged

wileymc merged 1 commit into
mainfrom
w/invite-account-switch

Conversation

@wileymc

@wileymc wileymc commented Sep 22, 2026

Copy link
Copy Markdown
Member

Opening an organization invitation while signed in to a different email now leads to an account-switch page before any login or registration form appears. The page shows the invited and current emails, offers “Switch accounts and continue,” and lets the user keep using their current account.

Switching signs out through the API, clears the previous account’s registration and organization state, and reloads the registration flow with the original invitation, destination, and locale intact. Failed sign-outs preserve the session and allow retry. Matching emails keep the existing acceptance flow, regardless of other organization memberships.

The guard refreshes the current session on entry and when returning from another tab. Email comparison ignores case and surrounding whitespace while preserving plus aliases. The link’s email guides the UI; the API remains responsible for validating the invitation recipient.

Validation:

  • 42 browser checks passed across Chromium and Firefox, including the existing invite regressions, stale/expired sessions, account switching, sign-out failure, multiple organizations, and locale preservation.
  • All 8 real local invite integration tests passed against the API and isolated PostgreSQL, with captured email and deterministic geocoding. Verified both cookies are cleared, the intended recipient joins, and the other account gains no membership.
  • TypeScript, targeted ESLint, Stylelint, and git diff --check passed; desktop and mobile layouts inspected.

@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
web Ready Ready Preview Sep 22, 2026 12:55am UTC

Request Review

@wileymc
wileymc merged commit 4f8c9ee into main Sep 22, 2026
2 checks passed
@wileymc
wileymc deleted the w/invite-account-switch branch September 22, 2026 01:52

This branch was successfully deployed

1 active deployment
Preview 9650bc30 Deployed Sep 22, 2026 by vercel[bot]
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