fix(console): point runtime auth url to accounts.svc.plus

This commit is contained in:
Haitao Pan 2026-03-30 23:06:42 +08:00
parent 4031e47cb4
commit e8dd9d9fe4
4 changed files with 33 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Base runtime configuration shared by all environments.
apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts.svc.plus
dashboardUrl: https://console.svc.plus
docsServiceUrl: https://docs.svc.plus
logLevel: info

View File

@ -3,11 +3,11 @@ logLevel: warn
regions:
cn:
apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts.svc.plus
dashboardUrl: https://console.svc.plus
docsServiceUrl: https://docs.svc.plus
global:
apiBaseUrl: https://rag-server-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts.svc.plus
dashboardUrl: https://console.svc.plus
docsServiceUrl: https://docs.svc.plus

View File

@ -1,4 +1,4 @@
apiBaseUrl: http://127.0.0.1:8080
authUrl: https://accounts-svc-plus-266500572462.asia-northeast1.run.app
authUrl: https://accounts.svc.plus
dashboardUrl: http://localhost:3000
logLevel: debug

View File

@ -0,0 +1,29 @@
// @vitest-environment node
import { afterAll, beforeEach, describe, expect, it } from "vitest";
const ORIGINAL_ENV = { ...process.env };
describe("runtime-loader", () => {
beforeEach(() => {
process.env = { ...ORIGINAL_ENV };
delete process.env.RUNTIME_ENV;
delete process.env.REGION;
delete process.env.RUNTIME_ENV_CONFIG_PATH;
delete process.env.ACCOUNT_SERVICE_URL;
delete process.env.NEXT_PUBLIC_ACCOUNT_SERVICE_URL;
});
afterAll(() => {
process.env = ORIGINAL_ENV;
});
it("loads the console runtime auth URL from the prod yaml config", async () => {
const { loadRuntimeConfig } = await import("./runtime-loader");
const config = loadRuntimeConfig({ hostname: "console.svc.plus" });
expect(config.authUrl).toBe("https://accounts.svc.plus");
expect(config.dashboardUrl).toBe("https://console.svc.plus");
});
});