make logout in n minutes

 it will caliculate time gap bewtween each request

if it is request cross greater thatn 10 minutes

its logout

axios.interceptors.request.use(function (request) { const d = new Date(); let current_time =d.getTime(); let api_request_timeout = (60000)*(globalVariables.api_request_timeout); let timeout = current_time - parseInt(globalVariables.last_request_time_stamp); if (api_request_timeout <= timeout){ router.push({ name: "logout" }).catch(() => {}); } globalVariables.last_request_time_stamp =current_time; return request; } );)

No comments:

Post a Comment

How to host application on server new way

 copy the htacess from public to root copy the server.php from public to root but rename to index.php htacess <IfModule mod_rewrite.c>...