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,9 +276,12 @@ void onApiSettingsPost(AsyncWebServerRequest *request)
if (request->hasParam(v, true))
{
AsyncWebParameter *pv = request->getParam(v, true);
// 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 {
preferences.putBool("useNode", false);
settingsChanged = true;