Skip to content

Commit 1d84ca3

Browse files
ranbenaarikfr
authored andcommitted
Added “next” param to form action (#3)
1 parent ef4dbed commit 1d84ca3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

views/login.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,15 @@
267267
document.getElementById('info').classList.toggle('active');
268268
}
269269

270+
function getNext() {
271+
var next = /next=(.*)/.exec(window.location.search); // assuming only search param
272+
return next ? '&next=' + next[1] : '';
273+
}
274+
270275
window.onload = function() {
271276
var form = document.getElementById('loginForm');
272277
form.addEventListener('submit', onSubmit);
273-
form.setAttribute('action', '/login?host=' + window.location.host);
278+
form.setAttribute('action', '/login?host='+ window.location.host + getNext());
274279
}
275280
</script>
276281
</head>

0 commit comments

Comments
 (0)