feat(router): prevent redirection from public landing pages on session expiration
This commit is contained in:
@@ -32,7 +32,9 @@ apiClient.interceptors.response.use(response => {
|
||||
return response;
|
||||
}, error => {
|
||||
if (error.response && error.response.status === 401) {
|
||||
store.dispatch('logout');
|
||||
// A failed background request may clear a stale browser session, but
|
||||
// it must not replace the visitor's current public landing URL.
|
||||
store.dispatch('logout', { redirectToHome: false });
|
||||
}
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user