From 8b4f2cb9949e159c7970858fed0008a729619a1f Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Wed, 20 Sep 2023 02:29:45 +0200 Subject: [PATCH] Fix settings so it doesn't overwrite node password --- src/lib/webserver.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/webserver.cpp b/src/lib/webserver.cpp index d6ea019..ea6ff0d 100644 --- a/src/lib/webserver.cpp +++ b/src/lib/webserver.cpp @@ -276,7 +276,10 @@ void onApiSettingsPost(AsyncWebServerRequest *request) if (request->hasParam(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 {