30 lines
748 B
JavaScript
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; |