From 43af07716e03f20778d961166e89aff75154a8a8 Mon Sep 17 00:00:00 2001 From: lumapu Date: Tue, 22 Nov 2022 10:32:04 +0100 Subject: [PATCH] fix logout --- src/config/config.h | 2 +- src/defines.h | 2 +- src/web/web.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/config/config.h b/src/config/config.h index 70a36f58..2b5a0688 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -26,7 +26,7 @@ //#define AP_ONLY // timeout for automatic logoff (20 minutes) -#define LOGOUT_TIMEOUT (20 * 60 * 60) +#define LOGOUT_TIMEOUT (20 * 60) //------------------------------------- // CONFIGURATION - COMPILE TIME diff --git a/src/defines.h b/src/defines.h index 36949daf..ea772a5f 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 5 -#define VERSION_PATCH 40 +#define VERSION_PATCH 42 //------------------------------------- typedef struct { diff --git a/src/web/web.cpp b/src/web/web.cpp index 45be992e..3db382ef 100644 --- a/src/web/web.cpp +++ b/src/web/web.cpp @@ -107,8 +107,10 @@ void web::loop(void) { void web::tickSecond() { if(0 != mLogoutTimeout) { mLogoutTimeout -= 1; - if(0 == mLogoutTimeout) - mProtected = true; + if(0 == mLogoutTimeout) { + if(strlen(mConfig->sys.adminPwd) > 0) + mProtected = true; + } DPRINTLN(DBG_DEBUG, "auto logout in " + String(mLogoutTimeout)); }