- added login page;
- added file upload; - added faq item edit modal;
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
//Navigate,
|
||||
Outlet } from 'react-router-dom';
|
||||
import { Navigate, Outlet } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../store';
|
||||
|
||||
// tools
|
||||
//import AuthenticationService from '../../service/authentication-service';
|
||||
import AuthenticationService from '../../service/authentication-service';
|
||||
|
||||
const ProtectedRoute = () => {
|
||||
// we need this to track existance of the token
|
||||
const token = useStore().main.token();
|
||||
|
||||
/*if (!AuthenticationService.wasLoggedIn()) {
|
||||
if (!AuthenticationService.wasLoggedIn()) {
|
||||
return (<Navigate to={'/login'} replace/>);
|
||||
}
|
||||
|
||||
@@ -18,10 +21,10 @@ const ProtectedRoute = () => {
|
||||
|
||||
if (!AuthenticationService.isLoggedIn()) {
|
||||
return (<Navigate to={'/login?redirectReason=auth_required'} replace/>);
|
||||
}*/
|
||||
}
|
||||
|
||||
/*if (window.location.pathname === '/') {
|
||||
return (<Navigate to={'/dashboard'} replace/>);
|
||||
return (<Navigate to={'/'} replace/>);
|
||||
}*/
|
||||
|
||||
return <Outlet/>;
|
||||
|
||||
Reference in New Issue
Block a user