From 31a8d9e68f01fda901aa9fb13ca50a009f91f083 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 19 Oct 2015 15:13:30 +0000 Subject: [PATCH] (Captiveportal, new) only redirect if redirurl is provided in default web template --- .../CaptivePortal/htdocs_default/index.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 @@ +