1
0
forked from baron/baron-sso

fix: resolve admin session infinite reload loop and sync auth state

- Prevent infinite redirection loop by clearing oidc-client user state on 401 errors.
- Sync apiClient request interceptor to use userManager.getUser() for reliable token retrieval.
- Add extensive console logs for better session issue diagnosis.
- Fix TS error in LoginPage by updating button variant.
- Revert 'ae03fe1' (updated playwright fixtures to real domain) as requested.
This commit is contained in:
2026-04-21 17:06:03 +09:00
parent ae03fe1475
commit 4427ab1f85
13 changed files with 119 additions and 52 deletions

View File

@@ -137,11 +137,11 @@ export async function seedAuth(page: Page, role?: string) {
};
window.localStorage.setItem(
"oidc.user:https://sso.hmac.kr/oidc:devfront",
"oidc.user:http://localhost:5000/oidc:devfront",
JSON.stringify(mockOidcUser),
);
window.localStorage.setItem(
"oidc.user:https://sso.hmac.kr/oidc/:devfront",
"oidc.user:http://localhost:5000/oidc/:devfront",
JSON.stringify(mockOidcUser),
);
window.localStorage.setItem("dev_role", injectedRole || "rp_admin");
@@ -155,12 +155,12 @@ export async function seedAuth(page: Page, role?: string) {
if (url.includes(".well-known/openid-configuration")) {
await route.fulfill({
json: {
issuer: "https://sso.hmac.kr/oidc",
authorization_endpoint: "https://sso.hmac.kr/oidc/auth",
token_endpoint: "https://sso.hmac.kr/oidc/token",
jwks_uri: "https://sso.hmac.kr/oidc/jwks",
userinfo_endpoint: "https://sso.hmac.kr/oidc/userinfo",
end_session_endpoint: "https://sso.hmac.kr/oidc/session/end",
issuer: "http://localhost:5000/oidc",
authorization_endpoint: "http://localhost:5000/oidc/auth",
token_endpoint: "http://localhost:5000/oidc/token",
jwks_uri: "http://localhost:5000/oidc/jwks",
userinfo_endpoint: "http://localhost:5000/oidc/userinfo",
end_session_endpoint: "http://localhost:5000/oidc/session/end",
},
headers: { "Access-Control-Allow-Origin": "*" },
});