1
0
forked from baron/baron-sso

callback 검증 보강. seed-tenant 추가보강

This commit is contained in:
2026-05-11 11:03:11 +09:00
parent f46a7cc088
commit 9a64a16cb9
28 changed files with 2832 additions and 133 deletions

View File

@@ -0,0 +1,29 @@
import { describe, expect, it } from "vitest";
import {
DEVFRONT_AUTH_CALLBACK_PATH,
buildDevFrontAuthRedirectUris,
resolveDevFrontPublicOrigin,
} from "./authConfig";
describe("devfront auth config", () => {
it("builds callback URLs from the public origin", () => {
expect(buildDevFrontAuthRedirectUris("https://sdev.hmac.kr")).toEqual({
redirectUri: "https://sdev.hmac.kr/auth/callback",
postLogoutRedirectUri: "https://sdev.hmac.kr",
popupRedirectUri: "https://sdev.hmac.kr/auth/callback",
});
});
it("uses the browser origin when the configured origin is empty or invalid", () => {
expect(resolveDevFrontPublicOrigin("", "http://localhost:5173")).toBe(
"http://localhost:5173",
);
expect(
resolveDevFrontPublicOrigin("not a url", "http://localhost:5173"),
).toBe("http://localhost:5173");
});
it("keeps the callback path aligned with the registered redirect path", () => {
expect(DEVFRONT_AUTH_CALLBACK_PATH).toBe("/auth/callback");
});
});