Persist relative return-to path for post-login redirect

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
2026-03-08 10:44:53 +08:00
parent e275e79a63
commit 8acb1b50de
2 changed files with 14 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ export default {
// }
async beforeRouteEnter(to, from, next) {
const loginStore = useLoginStore();
const relativeReturnTo = `${window.location.pathname}${window.location.search}${window.location.hash}`;
if (!getCookie("isLuciaLoggedIn")) {
if (getCookie('luciaRefreshToken')) {
@@ -61,7 +62,7 @@ export default {
next({
path: '/login',
query: {
'return-to': btoa(window.location.href),
'return-to': btoa(relativeReturnTo),
}
});
}
@@ -69,7 +70,7 @@ export default {
next({
path: '/login',
query: {
'return-to': btoa(window.location.href),
'return-to': btoa(relativeReturnTo),
}
});
}