Fix settings so it doesn't overwrite node password

This commit is contained in:
Djuri Baars 2023-09-20 02:29:45 +02:00
parent 48bb13b965
commit 8b4f2cb994

View file

@ -276,7 +276,10 @@ void onApiSettingsPost(AsyncWebServerRequest *request)
if (request->hasParam(v, true)) if (request->hasParam(v, true))
{ {
AsyncWebParameter *pv = request->getParam(v, true); AsyncWebParameter *pv = request->getParam(v, true);
preferences.putString(v.c_str(), pv->value().c_str()); // Don't store an empty password, probably new settings save
if (!(v.equals("rpcPass") && pv->value().length() == 0)) {
preferences.putString(v.c_str(), pv->value().c_str());
}
} }
} }
} else { } else {