forked from baron/baron-sso
devfront 개발모드 unkown로그인 제거
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect } from "react";
|
||||
import { useAuth } from "react-oidc-context";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { userManager } from "../../lib/auth";
|
||||
import { isValidOidcSessionUser } from "../../lib/oidcStorage";
|
||||
|
||||
export default function AuthCallbackPage() {
|
||||
const auth = useAuth();
|
||||
@@ -16,7 +17,7 @@ export default function AuthCallbackPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (auth.isAuthenticated) {
|
||||
if (auth.isAuthenticated && isValidOidcSessionUser(auth.user)) {
|
||||
const returnTo =
|
||||
typeof auth.user?.state === "object" &&
|
||||
auth.user?.state !== null &&
|
||||
@@ -29,7 +30,7 @@ export default function AuthCallbackPage() {
|
||||
console.error("Auth Error:", auth.error);
|
||||
navigate("/login", { replace: true });
|
||||
}
|
||||
}, [auth.isAuthenticated, auth.error, navigate, auth.user?.state]);
|
||||
}, [auth.isAuthenticated, auth.error, navigate, auth.user]);
|
||||
|
||||
return <div>Loading Auth...</div>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user