- added login page;

- added file upload;
- added faq item edit modal;
This commit is contained in:
Vitalii Kiiko
2024-08-23 16:55:19 +02:00
parent 0a21444ee4
commit 5095ed7365
50 changed files with 1540 additions and 576 deletions

View File

@@ -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/>;