MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / authMiddleware

Method authMiddleware

lib/webserver/esp-fs-webserver.cpp:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135WebServerClass::THandlerFunction FSWebServer::authMiddleware(WebServerClass::THandlerFunction fn)
136{
137 if (authUser.isEmpty() || m_apmode)
138 {
139 return fn;
140 }
141
142 return [this, fn]()
143 {
144 if (!webserver->authenticate(authUser.c_str(), authPass.c_str()))
145 {
146 return webserver->requestAuthentication();
147 }
148
149 fn();
150 };
151}
152
153void FSWebServer::setCaptiveWebage(const char *url)
154{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected