Files
bflows-bandi-fe/src/components/ProtectedRoute/index.js
Vitalii Kiiko 3690835fa1 progress
2024-08-14 09:53:55 +02:00

30 lines
748 B
JavaScript

import React from 'react';
import {
//Navigate,
Outlet } from 'react-router-dom';
// tools
//import AuthenticationService from '../../service/authentication-service';
const ProtectedRoute = () => {
/*if (!AuthenticationService.wasLoggedIn()) {
return (<Navigate to={'/login'} replace/>);
}
if (AuthenticationService.isExpired()) {
return (<Navigate to={'/login?redirectReason=expired'} replace/>);
}
if (!AuthenticationService.isLoggedIn()) {
return (<Navigate to={'/login?redirectReason=auth_required'} replace/>);
}*/
/*if (window.location.pathname === '/') {
return (<Navigate to={'/dashboard'} replace/>);
}*/
return <Outlet/>;
}
export default ProtectedRoute;