diff --git a/src/boot/axios.js b/src/boot/axios.js index cbd5e7213..f8f27278c 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -60,9 +60,10 @@ const onResponseError = (error) => { if (session.isLoggedIn() && response.status === 401) { session.destroy(); - Router.push({ path: '/login' }); - } else if(!session.isLoggedIn()) - { + const hash = window.location.hash; + const url = hash.slice(1); + Router.push({ path: url }); + } else if (!session.isLoggedIn()) { message = 'login.loginError'; } @@ -77,7 +78,4 @@ const onResponseError = (error) => { axios.interceptors.request.use(onRequest, onRequestError); axios.interceptors.response.use(onResponse, onResponseError); -export { - onRequest, - onResponseError -} +export { onRequest, onResponseError };