Google sign-in skips account chooser after sign-out (missing prompt=select_account)

Open Beginner friendly
#1,053 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Start in crates/services/src/auth/oauth.rs by reading google_auth_url and the current GET /v1/auth/google flow. Verify the generated Google authorization URL, apply the requested account-chooser behavior, and confirm that signing in again after sign-out presents the chooser; review github_auth_url separately because the issue describes that change as optional.

Written by the indexing model from the issue text.

Description

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

  1. Sign in to NEAR AI Cloud with Google (account chooser appears).
  2. Sign out.
  3. Click "Sign in with Google" again.
  4. Expected: Google account chooser appears. Actual: Google auto-selects the previous account and signs in immediately.
Dominant language
Rust
Stars
8
Forks
8
Avg merge
1d 16h
Merged PRs (30d)
37

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nearai/cloud-api

All issues in nearai/cloud-api

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.