diff --git a/src/opnsense/scripts/OPNsense/CaptivePortal/htdocs_default/index.html b/src/opnsense/scripts/OPNsense/CaptivePortal/htdocs_default/index.html index 1ea69543e..f69973ba4 100644 --- a/src/opnsense/scripts/OPNsense/CaptivePortal/htdocs_default/index.html +++ b/src/opnsense/scripts/OPNsense/CaptivePortal/htdocs_default/index.html @@ -51,7 +51,12 @@ }).done(function(data) { // redirect on successful login if (data['clientState'] == 'AUTHORIZED') { - window.location = 'http://'+getURLparams()['redirurl']+'?refresh'; + if (getURLparams()['redirurl'] != undefined) { + window.location = 'http://'+getURLparams()['redirurl']+'?refresh'; + } else { + // no target, reload page + window.location.reload(); + } } else { $("#inputUsername").val(""); $("#inputPassword").val(""); @@ -80,7 +85,11 @@ }).done(function(data) { // redirect on successful login if (data['clientState'] == 'AUTHORIZED') { - window.location = 'http://'+getURLparams()['redirurl']+'?refresh'; + if (getURLparams()['redirurl'] != undefined) { + window.location = 'http://'+getURLparams()['redirurl']+'?refresh'; + } else { + window.location.reload(); + } } else { $("#inputUsername").val(""); $("#inputPassword").val(""); @@ -182,6 +191,7 @@ +