From 83fa9a15b9fcc21024a6c6b0a57af23850485478 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 3 Jul 2024 14:18:38 +0200 Subject: [PATCH] feat: redirect to login with current path --- src/boot/axios.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boot/axios.js b/src/boot/axios.js index 4fd83ddea..fa8a08003 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -55,10 +55,10 @@ const onResponseError = (error) => { } if (session.isLoggedIn() && response?.status === 401) { - session.destroy(); + session.destroy(false); const hash = window.location.hash; const url = hash.slice(1); - Router.push({ path: url }); + Router.push(`/login?redirect=${url}`); } else if (!session.isLoggedIn()) { return Promise.reject(error); }