mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-22 19:34:06 +03:00
Merge pull request #593 from kinode-dao/dr/login-redirect
add redirect param to login page for loads where user already has cookie
This commit is contained in:
commit
8bdda8a683
@ -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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user