1
1
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:
dr-frmr 2024-11-04 08:25:43 -05:00
parent a33390a27f
commit bd00406646
No known key found for this signature in database

View File

@ -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>