Initial commit from prod-batam
This commit is contained in:
13
platform/app/src/routes/PrivateRoute.tsx
Normal file
13
platform/app/src/routes/PrivateRoute.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useUserAuthentication } from '@ohif/ui';
|
||||
|
||||
export const PrivateRoute = ({ children, handleUnauthenticated }) => {
|
||||
const [{ user, enabled }] = useUserAuthentication();
|
||||
|
||||
if (enabled && !user) {
|
||||
return handleUnauthenticated();
|
||||
}
|
||||
|
||||
return children;
|
||||
};
|
||||
|
||||
export default PrivateRoute;
|
||||
Reference in New Issue
Block a user