fix(auth): request Google's account chooser on legacy login - #987
Merged
Conversation
Pass prompt=select_account when generating the Google authorization URL in HandleLogin. Without this parameter, Google silently re-authenticates the single currently signed-in account if consent was previously granted, preventing users from switching accounts after signing out. Co-Authored-By: pi (gemini-3.8-flash) <noreply@tokencanopy.com> Claude-Session: https://claude.ai/code/session_01AjfGxvXW6fNKWGFHuo68yX
Member
Author
|
Independent review (Claude, on top of the pi/Gemini run) — verified rather than trusted:
Approve from my side; merge remains user-gated (OSS branch protection → admin-override merge once CI is green). |
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.
Summary
promptparameter was sent in the legacy Google OAuth login handler (HandleLogin), Google would silently re-authenticate a browser session that has a single signed-in Google account which had already consented. A user who signed out and clicked "Sign in with Google" was logged straight back in without being able to choose another account.oauth2.SetAuthURLParam("prompt", "select_account")toua.oauthConfig.AuthCodeURL(...)ininternal/auth/auth.go.access_type, state encoding, and the OIDC (TokenCanopy) login path remain completely unchanged. This touches only the legacy/api/auth/loginroute; no/v1endpoints, OpenAPI spec, or SDK regeneration are involved.Validation Commands and Results
make fmt-checkmake buildgo vet ./internal/auth/...make test-unitNote on pre-existing test failure:
make test-unitencounters a failure ingithub.com/tokencanopy/e2a/internal/relay(TestInboundActivityRecording_AuthenticatedMailUpdatesCountersininbound_activity_test.go:95: inbound_count = 0, want 1). This failure is pre-existing and reproducible on cleanmain.All tests in
github.com/tokencanopy/e2a/internal/authpass:Prepared by a pi agent (gemini-3.8-flash), reviewed before merge.