This commit is contained in:
victorAnumudu
2024-12-12 11:40:39 +01:00
parent ff7e1d9b3e
commit c81b1061d3
2 changed files with 3 additions and 5 deletions
+1 -5
View File
@@ -60,17 +60,13 @@ export default function UserExist() {
},[lastActivityTime]) },[lastActivityTime])
useEffect(()=>{ useEffect(()=>{
let token = localStorage.getItem('token')
if(!token){
return navigate(siteLinks.login)
}
accountDashboard().then(res => { accountDashboard().then(res => {
const {dash_data} = res?.data const {dash_data} = res?.data
setLoading(false) setLoading(false)
dispatch(updateUserDetails({ ...dash_data })); dispatch(updateUserDetails({ ...dash_data }));
}).catch(err => { }).catch(err => {
navigate(siteLinks.login) navigate(siteLinks.login)
setLoading(false)
}) })
},[]) },[])
+2
View File
@@ -33,6 +33,8 @@ const getAuxEnd = (path) => {
const basePath = process.env.REACT_APP_MAIN_API const basePath = process.env.REACT_APP_MAIN_API
return axios.get(`${basePath}${path}`).then(res => { return axios.get(`${basePath}${path}`).then(res => {
return res return res
// localStorage.clear();
// window.location.href = `/login?sessionExpired=true`;
}).catch(err => { }).catch(err => {
// throw new Error(err.response.data.message); // throw new Error(err.response.data.message);
return err return err