Browse Source

0.8.70

* fix login
* fix github actions Node.js 16 warnings
pull/1402/head
lumapu 12 months ago
parent
commit
9065ff5b98
  1. 12
      .github/workflows/compile_development.yml
  2. 11
      src/web/Protection.h

12
.github/workflows/compile_development.yml

@ -33,13 +33,13 @@ jobs:
- opendtufusion-ethernet
steps:
- uses: actions/checkout@v4
- uses: benjlevesque/short-sha@v2.1
- uses: benjlevesque/short-sha@v2.2
id: short-sha
with:
length: 7
- name: Cache Pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@ -47,7 +47,7 @@ jobs:
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
@ -93,13 +93,13 @@ jobs:
- opendtufusion-ethernet-de
steps:
- uses: actions/checkout@v4
- uses: benjlevesque/short-sha@v2.1
- uses: benjlevesque/short-sha@v2.2
id: short-sha
with:
length: 7
- name: Cache Pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@ -107,7 +107,7 @@ jobs:
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

11
src/web/Protection.h

@ -51,6 +51,7 @@ class Protection {
}
void unlock(const char *clientIp) {
mLogoutTimeout = LOGOUT_TIMEOUT;
mProtected = false;
ah::ip2Arr(static_cast<uint8_t*>(mLoginIp.data()), clientIp);
}
@ -70,14 +71,16 @@ class Protection {
if(mPwd[0] == '\0')
return false;
uint8_t ip[4];
ah::ip2Arr(ip, clientIp);
std::array<uint8_t, 4> ip;
ah::ip2Arr(static_cast<uint8_t*>(ip.data()), clientIp);
for(uint8_t i = 0; i < 4; i++) {
if(mLoginIp[i] != ip[i])
if(mLoginIp[i] != ip[i]) {
DPRINTLN(DBG_INFO, "ip nicht gleich!");
return true;
}
}
return true;
return false;
}
protected:

Loading…
Cancel
Save