import { ShieldHalf, LogIn, ExternalLink } from "lucide-react"; import { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { Button } from "../../components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../components/ui/card"; function LoginPage() { const navigate = useNavigate(); const [isLoggingIn, setIsLoggingIn] = useState(false); useEffect(() => { // Listen for login success message from the popup const handleMessage = (event: MessageEvent) => { // Security check: In production, verify event.origin if (event.data?.type === "LOGIN_SUCCESS" && event.data?.token) { window.localStorage.setItem("admin_session", event.data.token); setIsLoggingIn(false); navigate("/"); } }; window.addEventListener("message", handleMessage); return () => window.removeEventListener("message", handleMessage); }, [navigate]); const handleSSOLogin = () => { const userfrontUrl = import.meta.env.VITE_USERFRONT_URL || "https://sso.hmac.kr"; const loginUrl = `${userfrontUrl}/login?source=adminfront`; const width = 500; const height = 700; const left = window.screen.width / 2 - width / 2; const top = window.screen.height / 2 - height / 2; const popup = window.open( loginUrl, "BaronSSOLogin", `width=${width},height=${height},top=${top},left=${left},status=no,menubar=no,toolbar=no` ); if (popup) { setIsLoggingIn(true); // Optional: Polling to detect if popup was closed without login const timer = setInterval(() => { if (popup.closed) { clearInterval(timer); setIsLoggingIn(false); } }, 1000); } else { alert("팝업 차단이 설정되어 있습니다. 팝업 허용 후 다시 시도해 주세요."); } }; return (

Baron SSO

Admin Control Plane

관리자 로그인 Baron 통합 인증(SSO)을 통해 관리자 페이지에 접속합니다.

관리자 전역 세션은 보안을 위해 15분간 유지됩니다.
민감한 작업 시 재인증을 요구할 수 있습니다.

인증 정보가 없거나 로그인이 되지 않는 경우
시스템 관리자에게 문의하세요.

); } export default LoginPage;