forked from baron/baron-sso
SSO 로그인 방식을 팝업 기반으로 변경
This commit is contained in:
@@ -30,8 +30,9 @@ apiClient.interceptors.response.use(
|
||||
if (error.response?.status === 401) {
|
||||
// 401 발생 시 로그인 페이지로 리다이렉트
|
||||
const isAuthPath = window.location.pathname.startsWith("/callback");
|
||||
if (!isAuthPath) {
|
||||
userManager.signinRedirect();
|
||||
const isLoginPath = window.location.pathname === "/login";
|
||||
if (!isAuthPath && !isLoginPath) {
|
||||
window.location.href = "/login";
|
||||
}
|
||||
}
|
||||
return Promise.reject(error);
|
||||
|
||||
@@ -9,6 +9,7 @@ export const oidcConfig: AuthProviderProps = {
|
||||
response_type: "code",
|
||||
scope: "openid offline_access profile email", // offline_access for refresh token
|
||||
post_logout_redirect_uri: window.location.origin,
|
||||
popup_redirect_uri: `${window.location.origin}/auth/callback`,
|
||||
userStore: new WebStorageStateStore({ store: window.localStorage }),
|
||||
automaticSilentRenew: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user