Persist relative return-to path for post-login redirect
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -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),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user