diff --git a/src/CHANGES.md b/src/CHANGES.md index 863b6fba..b661b8d2 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -7,6 +7,8 @@ * removed add to total (MqTT) inverter setting * fixed sending commands to inverters which are soft turned off * save settings before they are exported #1395 +* fix autologin bug if no password is set +* translated `/serial` ## 0.8.70 - 2024-02-01 * prevent sending commands to inverter which isn't active #1387 diff --git a/src/web/Protection.h b/src/web/Protection.h index 710ba8b3..0c7b8379 100644 --- a/src/web/Protection.h +++ b/src/web/Protection.h @@ -39,7 +39,7 @@ class Protection { // auto logout if(0 != mLogoutTimeout) { if (0 == --mLogoutTimeout) { - if(mPwd[0] == '\0') + if(mPwd[0] != '\0') mProtected = true; } } diff --git a/src/web/RestApi.h b/src/web/RestApi.h index b2041ee7..e6760390 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -259,6 +259,8 @@ class RestApi { } void getGeneric(AsyncWebServerRequest *request, JsonObject obj) { + mApp->resetLockTimeout(); + obj[F("wifi_rssi")] = (WiFi.status() != WL_CONNECTED) ? 0 : WiFi.RSSI(); obj[F("ts_uptime")] = mApp->getUptime(); obj[F("ts_now")] = mApp->getTimestamp(); @@ -268,7 +270,7 @@ class RestApi { obj[F("env")] = String(ENV_NAME); obj[F("menu_prot")] = mApp->isProtected(request->client()->remoteIP().toString().c_str()); obj[F("menu_mask")] = (uint16_t)(mConfig->sys.protectionMask ); - obj[F("menu_protEn")] = (bool) (strlen(mConfig->sys.adminPwd) > 0); + obj[F("menu_protEn")] = (bool) (mConfig->sys.adminPwd[0] != '\0'); obj[F("cst_lnk")] = String(mConfig->plugin.customLink); obj[F("cst_lnk_txt")] = String(mConfig->plugin.customLinkText); obj[F("region")] = mConfig->sys.region; diff --git a/src/web/html/serial.html b/src/web/html/serial.html index 25940eb0..83e614c8 100644 --- a/src/web/html/serial.html +++ b/src/web/html/serial.html @@ -12,12 +12,12 @@