diff --git a/views/login.html b/views/login.html index b8b77bd..b93c98c 100644 --- a/views/login.html +++ b/views/login.html @@ -267,10 +267,15 @@ document.getElementById('info').classList.toggle('active'); } + function getNext() { + var next = /next=(.*)/.exec(window.location.search); // assuming only search param + return next ? '&next=' + next[1] : ''; + } + window.onload = function() { var form = document.getElementById('loginForm'); form.addEventListener('submit', onSubmit); - form.setAttribute('action', '/login?host=' + window.location.host); + form.setAttribute('action', '/login?host='+ window.location.host + getNext()); }