1
0
forked from baron/baron-sso

feat: SSO 로그인 리다이렉션 흐름 구현 (userfront & adminfront 연동) #243

This commit is contained in:
2026-02-11 15:20:17 +09:00
parent 3163514227
commit 9d7c28b1c1
5 changed files with 83 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
import { useEffect } from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import { ShieldHalf } from "lucide-react";
function AuthCallbackPage() {
const navigate = useNavigate();
const [searchParams] = useSearchParams();
useEffect(() => {
const token = searchParams.get("token");
if (token) {
window.localStorage.setItem("admin_session", token);
// Redirect to home after a short delay or immediately
navigate("/", { replace: true });
} else {
console.error("No token found in callback URL");
navigate("/login", { replace: true });
}
}, [navigate, searchParams]);
return (
<div className="flex min-h-screen items-center justify-center bg-background">
<div className="flex flex-col items-center gap-4">
<div className="flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/15 text-primary shadow-lg animate-pulse">
<ShieldHalf size={32} />
</div>
<div className="text-lg font-semibold"> ...</div>
<p className="text-sm text-muted-foreground"> .</p>
</div>
</div>
);
}
export default AuthCallbackPage;