Files
ohif-viewer/platform/app/src/routes/PrivateRoute.tsx
2025-05-27 11:05:07 +07:00

14 lines
297 B
TypeScript

import { useUserAuthentication } from '@ohif/ui';
export const PrivateRoute = ({ children, handleUnauthenticated }) => {
const [{ user, enabled }] = useUserAuthentication();
if (enabled && !user) {
return handleUnauthenticated();
}
return children;
};
export default PrivateRoute;