Auth Fix
CI / ci (push) Canceled after 0s

Fixed an issue where the user would be redirected to a localhost address because an auth url was not set in the env.
This commit is contained in:
Stefan Lazic committed 2026-09-06 21:01:54 +01:00
1 parent e9e28a243f
commit cbeccc6c1f
8 files changed
+420 -71

No files matched your search

@@ -35,3 +35,17 @@ describe("generateBusinessEnv — INSTALLATION_TOKEN", () => {
expect(envB).not.toContain("token-a");
});
});
describe("generateBusinessEnv — AUTH_URL", () => {
it("sets AUTH_URL explicitly to the business's own https domain — not left to header-based detection", () => {
const env = generateBusinessEnv(baseValues);
expect(env).toContain('AUTH_URL="https://acme.example.com"');
});
it("AUTH_URL always matches DOMAIN/NEXT_PUBLIC_APP_URL for a given business", () => {
const env = generateBusinessEnv({ ...baseValues, domain: "other-business.example.com" });
expect(env).toContain('DOMAIN="other-business.example.com"');
expect(env).toContain('AUTH_URL="https://other-business.example.com"');
expect(env).toContain('NEXT_PUBLIC_APP_URL="https://other-business.example.com"');
});
});