fix(console): point runtime auth url to accounts.svc.plus
This commit is contained in:
parent
4031e47cb4
commit
e8dd9d9fe4
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
29
src/server/runtime-loader.test.ts
Normal file
29
src/server/runtime-loader.test.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user