disable captiveportal for webportal

This commit is contained in:
tablatronix
2023-11-17 19:37:44 -06:00
parent 9df7acdeeb
commit 3efb536629
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -2422,7 +2422,7 @@ void WiFiManager::handleNotFound() {
*/
boolean WiFiManager::captivePortal() {
if(!_enableCaptivePortal) return false; // skip redirections, @todo maybe allow redirection even when no cp ? might be useful
if(!_enableCaptivePortal || !configPortalActive) return false; // skip redirections if cp not enabled or not in ap mode
String serverLoc = toStringIp(server->client().localIP());
+7
View File
@@ -767,8 +767,15 @@ private:
boolean abort = false;
boolean reset = false;
boolean configPortalActive = false;
// these are state flags for portal mode, we are either in webportal mode(STA) or configportal mode(AP)
// these are mutually exclusive as STA+AP mode is not supported due to channel restrictions and stability
// if we decide to support this, these checks will need to be replaced with something client aware to check if client origin is ap or web
// These state checks are critical and used for internal function checks
boolean webPortalActive = false;
boolean portalTimeoutResult = false;
boolean portalAbortResult = false;
boolean storeSTAmode = true; // option store persistent STA mode in connectwifi
int timer = 0; // timer for debug throttle for numclients, and portal timeout messages