feat: redirect to login with current path
This commit is contained in:
parent
825e4497d2
commit
83fa9a15b9
|
@ -55,10 +55,10 @@ const onResponseError = (error) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session.isLoggedIn() && response?.status === 401) {
|
if (session.isLoggedIn() && response?.status === 401) {
|
||||||
session.destroy();
|
session.destroy(false);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
const url = hash.slice(1);
|
const url = hash.slice(1);
|
||||||
Router.push({ path: url });
|
Router.push(`/login?redirect=${url}`);
|
||||||
} else if (!session.isLoggedIn()) {
|
} else if (!session.isLoggedIn()) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue