fix(cli): pass api_url to UI for OAuth to ensure same backend is used
Problem
Fixes https://gitlab.com/postgres-ai/platform/-/issues/370
When a user has a custom apiBaseUrl in their CLI config, OAuth authentication fails with "OAuth session not found" because CLI and UI hit different backends.
Root Cause
-
CLI calls
oauth_initon configured API (e.g., stagingv2.postgres.ai) → session created there -
UI calls
oauth_approveon its default API (productionpostgres.ai) → session NOT found
Solution
Pass api_url parameter to the UI so it calls oauth_approve on the same backend where oauth_init created the session.
- const authUrl = `${uiBaseUrl}/cli/auth?state=...&redirect_uri=...`
+ const authUrl = `${uiBaseUrl}/cli/auth?state=...&redirect_uri=...&api_url=${apiBaseUrl}`
Related
- Requires UI change in
platform-uirepo
Edited by Nikolay Samokhvalov