mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 05:54:34 +02:00
Disable SESSION_LIFETIME environment var which interferes with autolock
This commit is contained in:
10
resources/js/api.js
vendored
10
resources/js/api.js
vendored
@ -20,11 +20,10 @@ Vue.axios.interceptors.response.use(response => response, error => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
// Otherwise we push to a specific or generic error view
|
||||
let routeName = 'genericError'
|
||||
|
||||
// Push to the login view and force the page to refresh to get a fresh CSRF token
|
||||
if ( error.response.status === 401 ) {
|
||||
routeName = 'login'
|
||||
router.push({ name: 'login', params: { forceRefresh: true } })
|
||||
throw new Vue.axios.Cancel();
|
||||
}
|
||||
|
||||
if ( error.response.status === 407 ) {
|
||||
@ -32,6 +31,9 @@ Vue.axios.interceptors.response.use(response => response, error => {
|
||||
throw new Vue.axios.Cancel();
|
||||
}
|
||||
|
||||
// we push to a specific or generic error view
|
||||
let routeName = 'genericError'
|
||||
|
||||
// api calls are stateless so when user inactivity is detected
|
||||
// by the backend middleware it cannot logout the user directly
|
||||
// so it returns a 418 response.
|
||||
|
Reference in New Issue
Block a user