1
0
forked from baron/baron-sso

adminfront 로그인 페이지에 auto redirect SSO 진입 추가

This commit is contained in:
2026-04-08 10:49:39 +09:00
parent c7b213bf17
commit 24f477a28e
2 changed files with 48 additions and 3 deletions

View File

@@ -14,7 +14,14 @@ function AuthCallbackPage() {
if (user?.access_token) {
window.localStorage.setItem("admin_session", user.access_token);
}
navigate("/", { replace: true });
const returnTo =
typeof auth.user?.state === "object" &&
auth.user?.state !== null &&
"returnTo" in auth.user.state &&
typeof auth.user.state.returnTo === "string"
? auth.user.state.returnTo
: "/";
navigate(returnTo, { replace: true });
} else if (auth.error) {
console.error("Auth Error:", auth.error);
navigate("/login", { replace: true });