From eac3c8c2427f9a6f2f001bbeb6e212c50d08776f Mon Sep 17 00:00:00 2001 From: minhn4 Date: Tue, 25 Aug 2026 18:02:11 +0700 Subject: [PATCH] feat(gateway): point the client at another codev-backend with CODEV_BACKEND_URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Testing a codev-backend change end-to-end meant editing the baked BACKEND_URL and remembering to put it back — and a localhost URL that slips into a commit points every user's client at their own machine, which is a silent, total sign-in outage. Unset, the baked URL is what ships, so this is inert in every real install. SSO is deliberately not overridable: a locally-run backend still verifies tokens against the real provider, so the login flow has to mint a real one. Only the exchange moves. Co-Authored-By: Claude Opus 5 (1M context) --- packages/codev-gateway/src/const.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/codev-gateway/src/const.ts b/packages/codev-gateway/src/const.ts index ac634866ce..d6bb46894d 100644 --- a/packages/codev-gateway/src/const.ts +++ b/packages/codev-gateway/src/const.ts @@ -2,7 +2,12 @@ // a standalone CoDev Code install can configure the gateway without the hub. // Base64 (like the hub) to keep the host out of casual greps, not as a secret. const BASE_URL = atob("aHR0cHM6Ly9uZXRtaW5kLnZpZXR0ZWwudm4=") -export const BACKEND_URL = `${BASE_URL}/codev-backend` +// `CODEV_BACKEND_URL` points the client at a codev-backend running somewhere +// else — `bun dev` in that repo serves http://127.0.0.1:8787. Unset in every +// real install, so the baked URL is what ships. SSO is deliberately NOT +// overridable: a local backend still verifies tokens against the real +// provider, so the login flow has to mint a real one. +export const BACKEND_URL = process.env.CODEV_BACKEND_URL || `${BASE_URL}/codev-backend` export const SSO_URL = `${BASE_URL}/sso-wrapper` export const LOGIN_SUCCESS_URL = `${BASE_URL}/codev/oauth/success`