enable authentication
This commit is contained in:
parent
daaabe5f26
commit
cd271efddd
|
@ -106,6 +106,7 @@ void ESPMegaWebServer::setWebPassword(const char* password)
|
||||||
|
|
||||||
void ESPMegaWebServer::dashboardHandler(AsyncWebServerRequest *request)
|
void ESPMegaWebServer::dashboardHandler(AsyncWebServerRequest *request)
|
||||||
{
|
{
|
||||||
|
request->authenticate(this->webUsername, this->webPassword);
|
||||||
auto bindedDashboardProcessor = std::bind(&ESPMegaWebServer::dashboardProcessor, this, std::placeholders::_1);
|
auto bindedDashboardProcessor = std::bind(&ESPMegaWebServer::dashboardProcessor, this, std::placeholders::_1);
|
||||||
request->send_P(200, "text/html", ota_html, bindedDashboardProcessor);
|
request->send_P(200, "text/html", ota_html, bindedDashboardProcessor);
|
||||||
}
|
}
|
||||||
|
@ -150,6 +151,7 @@ String ESPMegaWebServer::dashboardProcessor(const String &var)
|
||||||
|
|
||||||
void ESPMegaWebServer::configHandler(AsyncWebServerRequest *request)
|
void ESPMegaWebServer::configHandler(AsyncWebServerRequest *request)
|
||||||
{
|
{
|
||||||
|
request->authenticate(this->webUsername, this->webPassword);
|
||||||
auto bindedConfigProcessor = std::bind(&ESPMegaWebServer::configProcessor, this, std::placeholders::_1);
|
auto bindedConfigProcessor = std::bind(&ESPMegaWebServer::configProcessor, this, std::placeholders::_1);
|
||||||
request->send_P(200, "text/html", config_html, bindedConfigProcessor);
|
request->send_P(200, "text/html", config_html, bindedConfigProcessor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue