From e3d8e661cf394a0b70d3823c1222337016ea686b Mon Sep 17 00:00:00 2001 From: Ran Byron Date: Wed, 19 Jun 2019 09:52:42 +0300 Subject: [PATCH] =?UTF-8?q?Added=20=E2=80=9Cnext=E2=80=9D=20param=20to=20f?= =?UTF-8?q?orm=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/login.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()); }