Browse Source

Option to disable password change when using default password

fastled
Xose Pérez 7 years ago
parent
commit
a4a58c0117
2 changed files with 10 additions and 6 deletions
  1. +1
    -0
      code/espurna/config/general.h
  2. +9
    -6
      code/espurna/web.ino

+ 1
- 0
code/espurna/config/general.h View File

@ -78,6 +78,7 @@
#define WIFI_RECONNECT_INTERVAL 300000 #define WIFI_RECONNECT_INTERVAL 300000
#define WIFI_MAX_NETWORKS 5 #define WIFI_MAX_NETWORKS 5
#define ADMIN_PASS "fibonacci" #define ADMIN_PASS "fibonacci"
#define FORCE_CHANGE_PASS 1
#define HTTP_USERNAME "admin" #define HTTP_USERNAME "admin"
#define WS_BUFFER_SIZE 5 #define WS_BUFFER_SIZE 5
#define WS_TIMEOUT 1800000 #define WS_TIMEOUT 1800000


+ 9
- 6
code/espurna/web.ino View File

@ -647,13 +647,16 @@ void _onHome(AsyncWebServerRequest *request) {
if (!_authenticate(request)) return request->requestAuthentication(); if (!_authenticate(request)) return request->requestAuthentication();
String password = getSetting("adminPass", ADMIN_PASS);
if (password.equals(ADMIN_PASS)) {
request->send(SPIFFS, "/password.html");
} else {
#if FORCE_CHANGE_PASS == 1
String password = getSetting("adminPass", ADMIN_PASS);
if (password.equals(ADMIN_PASS)) {
request->send(SPIFFS, "/password.html");
} else {
request->send(SPIFFS, "/index.html");
}
#else
request->send(SPIFFS, "/index.html"); request->send(SPIFFS, "/index.html");
}
#endif
} }
void _onAuth(AsyncWebServerRequest *request) { void _onAuth(AsyncWebServerRequest *request) {


Loading…
Cancel
Save