From cd271efddd4a73e145bdee237284653341315348 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 1 Jan 2024 20:31:06 +0700 Subject: [PATCH] enable authentication --- ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.cpp b/ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.cpp index b438ad2..76f7630 100644 --- a/ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.cpp +++ b/ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.cpp @@ -106,6 +106,7 @@ void ESPMegaWebServer::setWebPassword(const char* password) void ESPMegaWebServer::dashboardHandler(AsyncWebServerRequest *request) { + request->authenticate(this->webUsername, this->webPassword); auto bindedDashboardProcessor = std::bind(&ESPMegaWebServer::dashboardProcessor, this, std::placeholders::_1); request->send_P(200, "text/html", ota_html, bindedDashboardProcessor); } @@ -150,6 +151,7 @@ String ESPMegaWebServer::dashboardProcessor(const String &var) void ESPMegaWebServer::configHandler(AsyncWebServerRequest *request) { + request->authenticate(this->webUsername, this->webPassword); auto bindedConfigProcessor = std::bind(&ESPMegaWebServer::configProcessor, this, std::placeholders::_1); request->send_P(200, "text/html", config_html, bindedConfigProcessor); }