fix: use public origins for SSO redirects

This commit is contained in:
2026-07-20 15:04:20 +05:30
parent a75779fa4d
commit 944f83d3f4
57 changed files with 138 additions and 89 deletions
+12
View File
@@ -85,6 +85,18 @@ test("forward auth describes the original gateway request", () => {
expect(headers.get("authorization")).toBe("Bearer token");
});
test("forward auth uses the protected app public protocol", () => {
const headers = forwardAuthHeaders(
new Request("http://127.0.0.1:10050/settings", {
headers: { host: "admin.wrnx.in" },
}),
"https://admin.wrnx.in",
);
expect(headers.get("x-original-host")).toBe("admin.wrnx.in");
expect(headers.get("x-original-proto")).toBe("https");
});
test("nested SSO proxy keeps the protected app's original request headers", () => {
const authHeaders = forwardAuthHeaders(
new Request("http://admin.localhost:3000/settings", {