forked from baron/baron-sso
Align RP auto login launch behavior
This commit is contained in:
@@ -22,7 +22,13 @@ export default function AuthGuard() {
|
||||
}
|
||||
|
||||
if (!auth.isAuthenticated) {
|
||||
return <Navigate to="/login" replace />;
|
||||
const returnTo = `${location.pathname}${location.search}`;
|
||||
return (
|
||||
<Navigate
|
||||
to={`/login?returnTo=${encodeURIComponent(returnTo)}`}
|
||||
replace
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// 조직도 앱은 일반 사용자(user)도 볼 수 있어야 하므로 접근 제한을 해제합니다.
|
||||
|
||||
@@ -18,7 +18,7 @@ function LoginPage() {
|
||||
const [searchParams] = useSearchParams();
|
||||
const autoStartedRef = useRef(false);
|
||||
const returnTo = searchParams.get("returnTo") || "/chart";
|
||||
const shouldAutoLogin = searchParams.get("auto") === "1";
|
||||
const shouldAutoLogin = searchParams.get("auto") !== "0";
|
||||
|
||||
useEffect(() => {
|
||||
if (auth.isAuthenticated) {
|
||||
|
||||
@@ -56,8 +56,8 @@ export function getOrgChartUserDisplayName(
|
||||
const { jobTitle, position } = getUserOrgProfile(user, tenant);
|
||||
const baseName = user.name.trim();
|
||||
|
||||
if (jobTitle && position) return `${baseName} ${position}[${jobTitle}]`;
|
||||
if (jobTitle) return `${baseName}[${jobTitle}]`;
|
||||
if (jobTitle && position) return `${baseName}(${jobTitle}) ${position}`;
|
||||
if (jobTitle) return `${baseName}(${jobTitle})`;
|
||||
if (position) return `${baseName} ${position}`;
|
||||
return baseName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user