forked from baron/baron-sso
Merge pull request '로그인 설정 업데이트' (#390) from fix/login into dev
Reviewed-on: baron/baron-sso#390
This commit is contained in:
@@ -59,7 +59,7 @@ ADMIN_PASSWORD=adminPasswordIsNotSimple
|
|||||||
USERFRONT_URL=https://sso.hmac.kr
|
USERFRONT_URL=https://sso.hmac.kr
|
||||||
|
|
||||||
# Services proxied via Nginx
|
# Services proxied via Nginx
|
||||||
BACKEND_URL=${USERFRONT_URL}/api
|
BACKEND_URL=${USERFRONT_URL}
|
||||||
OATHKEEPER_PUBLIC_URL=${USERFRONT_URL}
|
OATHKEEPER_PUBLIC_URL=${USERFRONT_URL}
|
||||||
|
|
||||||
# ory-stack 변수들
|
# ory-stack 변수들
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const router = createBrowserRouter(
|
|||||||
element: <LoginPage />,
|
element: <LoginPage />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/callback",
|
path: "/auth/callback",
|
||||||
element: <AuthCallbackPage />,
|
element: <AuthCallbackPage />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ apiClient.interceptors.response.use(
|
|||||||
async (error) => {
|
async (error) => {
|
||||||
if (error.response?.status === 401) {
|
if (error.response?.status === 401) {
|
||||||
// 401 발생 시 로그인 페이지로 리다이렉트
|
// 401 발생 시 로그인 페이지로 리다이렉트
|
||||||
const isAuthPath = window.location.pathname.startsWith("/callback");
|
const isAuthPath = window.location.pathname.startsWith("/auth/callback");
|
||||||
const isLoginPath = window.location.pathname === "/login";
|
const isLoginPath = window.location.pathname === "/login";
|
||||||
const user = await userManager.getUser();
|
const user = await userManager.getUser();
|
||||||
// 인증 토큰이 없는 경우에만 로그인으로 보낸다.
|
// 인증 토큰이 없는 경우에만 로그인으로 보낸다.
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ export const oidcConfig: AuthProviderProps = {
|
|||||||
authority:
|
authority:
|
||||||
import.meta.env.VITE_OIDC_AUTHORITY || "http://localhost:5000/oidc", // Gateway Proxy URL
|
import.meta.env.VITE_OIDC_AUTHORITY || "http://localhost:5000/oidc", // Gateway Proxy URL
|
||||||
client_id: import.meta.env.VITE_OIDC_CLIENT_ID || "devfront",
|
client_id: import.meta.env.VITE_OIDC_CLIENT_ID || "devfront",
|
||||||
redirect_uri: `${window.location.origin}/callback`,
|
redirect_uri: `${window.location.origin}/auth/callback`,
|
||||||
response_type: "code",
|
response_type: "code",
|
||||||
scope: "openid offline_access profile email", // offline_access for refresh token
|
scope: "openid offline_access profile email", // offline_access for refresh token
|
||||||
post_logout_redirect_uri: window.location.origin,
|
post_logout_redirect_uri: window.location.origin,
|
||||||
popup_redirect_uri: `${window.location.origin}/callback`,
|
popup_redirect_uri: `${window.location.origin}/auth/callback`,
|
||||||
userStore: new WebStorageStateStore({ store: window.localStorage }),
|
userStore: new WebStorageStateStore({ store: window.localStorage }),
|
||||||
automaticSilentRenew: true,
|
automaticSilentRenew: true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user