mirror of
https://github.com/uqbar-dao/nectar.git
synced 2025-01-07 01:56:31 +03:00
add redirect param to login page for loads where user already has cookie
This commit is contained in:
parent
a33390a27f
commit
bd00406646
@ -231,7 +231,18 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Check for redirect parameter on page load
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const redirectPath = urlParams.get('redirect');
|
||||
if (redirectPath) {
|
||||
// Ensure the redirect path starts with a slash
|
||||
const path = redirectPath.startsWith('/') ? redirectPath : '/' + redirectPath;
|
||||
window.location.href = path;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user