Skip to content

Commit

Permalink
Merge branch 'master' into feature_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Nov 17, 2023
2 parents d151c2b + 0e20168 commit 4e5400e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: ";
Expand Down
6 changes: 3 additions & 3 deletions examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 4e5400e

Please sign in to comment.