mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-15 01:18:26 +08:00
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
15 lines
350 B
TypeScript
15 lines
350 B
TypeScript
import { useAuth } from '@/hooks/auth-hooks';
|
|
import { redirectToLogin } from '@/utils/authorization-util';
|
|
import { Outlet } from 'react-router';
|
|
|
|
export default function AuthWrapper() {
|
|
const { isLogin } = useAuth();
|
|
if (isLogin === true) {
|
|
return <Outlet />;
|
|
} else if (isLogin === false) {
|
|
redirectToLogin();
|
|
}
|
|
|
|
return <></>;
|
|
}
|