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

sun dried potato procedure

  Sun-Dried Potato Chips Recipe  https://www.youtube.com/watch?v=e_PVvAU77Qs , recipe for potato sun dried chips 1) ist peel off the potato ...