Problem
After signing out of NEAR AI Cloud and signing back in with Google, users are not shown the Google account chooser. Google silently re-selects the previously used account, so there is no way to switch to a different Google account without signing out of Google itself.
The chooser only appears on the very first sign-in (before the user has granted consent to the app).
Cause
The Google authorization URL built in crates/services/src/auth/oauth.rs (google_auth_url) does not set a prompt parameter. The redirect currently issued by GET /v1/auth/google contains only:
response_type, client_id, state, code_challenge, code_challenge_method, redirect_uri, scope=email openid profile
Without prompt, Google skips the account chooser whenever the user has an active Google session and has already consented.
The frontend cannot work around this: /v1/auth/google only accepts frontend_callback (OAuthInitQuery) and does not forward other query parameters to Google.
Proposed fix
Add prompt=select_account to the Google authorization URL:
.set_pkce_challenge(pkce_challenge)
.add_extra_param("prompt", "select_account")
.url();
select_account shows the chooser on every sign-in without forcing the consent screen again. nearai/agents-market-v2 already does this in crates/services/src/oauth/google.rs.
GitHub has the same behavior, and GitHub's authorize endpoint also supports prompt=select_account, so github_auth_url could get the same change.
Steps to reproduce
- Sign in to NEAR AI Cloud with Google (account chooser appears).
- Sign out.
- Click "Sign in with Google" again.
- Expected: Google account chooser appears. Actual: Google auto-selects the previous account and signs in immediately.
Problem
After signing out of NEAR AI Cloud and signing back in with Google, users are not shown the Google account chooser. Google silently re-selects the previously used account, so there is no way to switch to a different Google account without signing out of Google itself.
The chooser only appears on the very first sign-in (before the user has granted consent to the app).
Cause
The Google authorization URL built in
crates/services/src/auth/oauth.rs(google_auth_url) does not set apromptparameter. The redirect currently issued byGET /v1/auth/googlecontains only:Without
prompt, Google skips the account chooser whenever the user has an active Google session and has already consented.The frontend cannot work around this:
/v1/auth/googleonly acceptsfrontend_callback(OAuthInitQuery) and does not forward other query parameters to Google.Proposed fix
Add
prompt=select_accountto the Google authorization URL:select_accountshows the chooser on every sign-in without forcing the consent screen again.nearai/agents-market-v2already does this incrates/services/src/oauth/google.rs.GitHub has the same behavior, and GitHub's authorize endpoint also supports
prompt=select_account, sogithub_auth_urlcould get the same change.Steps to reproduce