Compare commits

...

2 Commits

+4 -1
View File
@@ -34,6 +34,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
window.addEventListener('keydown', resetTime)
const loadProfile = ()=>{ // function to load user profile
setIsLogin({loading: true, status: false})
apiCall.loadProfile().then((res)=>{
if(res.data.internal_return < 0){
setIsLogin({loading: false, status: false})
@@ -50,7 +51,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, [])
useEffect(() => {
getProfile()
if(!isLogin.status){
getProfile()
}
const checkInactivity = setInterval(() => {
if (Date.now() - lastActivityTime > process.env.REACT_APP_SESSION_EXPIRE_MINUTES) {