forked from baron/baron-sso
callback 검증 보강. seed-tenant 추가보강
This commit is contained in:
27
adminfront/src/lib/authConfig.test.ts
Normal file
27
adminfront/src/lib/authConfig.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildAdminAuthRedirectUris,
|
||||
resolveAdminPublicOrigin,
|
||||
} from "./authConfig";
|
||||
|
||||
describe("admin auth config", () => {
|
||||
it("uses the explicit public admin origin for staging callback URLs", () => {
|
||||
const publicOrigin = resolveAdminPublicOrigin(
|
||||
"https://sadmin.hmac.kr",
|
||||
"http://127.0.0.1:5173",
|
||||
);
|
||||
|
||||
expect(publicOrigin).toBe("https://sadmin.hmac.kr");
|
||||
expect(buildAdminAuthRedirectUris(publicOrigin)).toEqual({
|
||||
redirectUri: "https://sadmin.hmac.kr/auth/callback",
|
||||
postLogoutRedirectUri: "https://sadmin.hmac.kr",
|
||||
popupRedirectUri: "https://sadmin.hmac.kr/auth/callback",
|
||||
});
|
||||
});
|
||||
|
||||
it("falls back to the browser origin when no explicit public origin is set", () => {
|
||||
expect(resolveAdminPublicOrigin("", "http://localhost:5173")).toBe(
|
||||
"http://localhost:5173",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user