@bradders You'll want to use an Axios interceptor for this... it will detect a session expiration then send the user to log back in instead of just wonking out and sitting there.
window.axios.interceptors.response.use(
function(response) {
// Call was successful, don't do anything special.
return response;
},
function (error) {
switch (error.response.status) {
case 401: // Not logged in
case 419: // Session expired
case 503: // Down for maintenance
// Bounce the user to the login screen with a redirect back
window.location.reload();
break;
case 500:
alert('Oops, something went wrong! The team have been notified.');
break;
default:
// Allow individual requests to handle other errors
return Promise.reject(error);
}
});
Also, you should bump your session timeout in your env to whatever is good for you. Typical practice is to set it to like 30 days now.
Jess Archer explains in this video... https://youtu.be/Zv4bUXEwl20?t=717
SESSION_LIFETIME=43200 # 30 Days