diff --git a/kinode/src/http/login.html b/kinode/src/http/login.html
index 6d197345..afcff2ef 100644
--- a/kinode/src/http/login.html
+++ b/kinode/src/http/login.html
@@ -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;
+ }
+ });