diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 2c84b2a7..c487cfa3 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -1809,6 +1809,13 @@ void WiFiManager::handleWifiSave() { _ssid = server->arg(F("s")).c_str(); _pass = server->arg(F("p")).c_str(); + if(_ssid = "" && _pass != ""){ + _ssid = WiFi_SSID(true); // password change, placeholder ssid, @todo compare pass to old?, confirm ssid is clean + #ifdef WM_DEBUG_LEVEL + DEBUG_WM(WM_DEBUG_VERBOSE,F("Detected WiFi password change")); + #endif + } + #ifdef WM_DEBUG_LEVEL String requestinfo = "SERVER_REQUEST\n----------------\n"; requestinfo += "URI: "; diff --git a/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino b/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino index 132e5d68..2b416691 100644 --- a/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino +++ b/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino @@ -79,16 +79,16 @@ void bindServerCallback(){ // you can override wm route endpoints, I have not found a way to remove handlers, but this would let you disable them or add auth etc. // wm.server->on("/info",handleNotFound); // wm.server->on("/update",handleNotFound); - wm.server->on("/erase",handleNotFound); + wm.server->on("/erase",handleNotFound); // disable erase } void handleRoute(){ - Serial.println("[HTTP] handle route"); + Serial.println("[HTTP] handle custom route"); wm.server->send(200, "text/plain", "hello from user code"); } void handleNotFound(){ - Serial.println("[HTTP] handle route"); + Serial.println("[HTTP] override handle route"); wm.handleNotFound(); }