Skip to content

fix(authlogin): allow account switching from password organization login - #127239

Closed
mvanhorn wants to merge 2 commits into
getsentry:masterfrom
mvanhorn:fix/127164-org-login-account-switch
Closed

mvanhorn wants to merge 2 commits into
getsentry:masterfrom
mvanhorn:fix/127164-org-login-account-switch

Conversation

@mvanhorn

Copy link
Copy Markdown

Organization warnings are rendered as plain-text alerts ahead of the session warning and the login banner. Outside single-organization mode, a signed-in user on a password organization with no provider also gets a Sign in with a different account button. That button calls the existing logout helper with an API client that stays alive across navigation, and logout sends the browser to the current organization login path and query string, or to a single-logout URL when the logout response includes one. The button stays busy and ignores further clicks until the request settles, and a failure stays on the page with a retryable error.

A signed-in user who is not a member of a password-only organization is sent to that organization's login page and sees only a disabled SSO button. The password form is missing and there is no way to sign out or use another account, so the page in the next parameter stays unreachable. Focused organization auth hides email and password on multi-org SaaS whenever the user is signed in but is not a member, and with no auth provider the remaining SSO button is disabled. The organization config already returns a membership warning, but the login page never rendered those warnings.

Ran make test-selective locally on macOS; it hit its time limit before finishing.
Tests for this live in static/app/views/authV2/authLogin/index.spec.tsx.
The tests in static/app/views/authV2/authLogin/index.spec.tsx fail without the fix (checked by reverting the source changes).

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes #127164

@mvanhorn
mvanhorn requested review from a team as code owners October 13, 2026 12:12
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 13, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7081456. Configure here.

Organization warnings are rendered as plain-text alerts ahead of the
session warning and the login banner. Outside single-organization mode,
a signed-in user on a password organization with no provider also gets a
Sign in with a different account button. That button calls the existing
logout helper with an API client that stays alive across navigation, and
logout sends the browser to the current organization login path and
query string, or to a single-logout URL when the logout response
includes one. The button stays busy and ignores further clicks until the
request settles, and a failure stays on the page with a retryable error.

Fixes getsentry#127164
On an organization login page with a session_expired cookie, the auth
config and the organization config both return the same session-expired
message, so the alert rendered twice. Skip the auth config warning when
the organization warnings already contain it.
@mvanhorn
mvanhorn force-pushed the fix/127164-org-login-account-switch branch from 7081456 to 9123bf6 Compare October 14, 2026 06:43
@getsantry

getsantry Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Nov 4, 2026
@getsantry getsantry Bot closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Org login dead-ends for signed-in non-members without SSO

1 participant