[web_server] Conditionally compile authentication code to save flash memory (#10022)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2025-08-04 14:09:12 +12:00
1 parent a75f73dbf0
commit 494a1a216c
7 files changed
+21

No files matched your search

@@ -14,9 +14,11 @@ WebServerBase *global_web_server_base = nullptr; // NOLINT(cppcoreguidelines-av
void WebServerBase::add_handler(AsyncWebHandler *handler) {
// remove all handlers
#ifdef USE_WEBSERVER_AUTH
if (!credentials_.username.empty()) {
handler = new internal::AuthMiddlewareHandler(handler, &credentials_);
}
#endif
this->handlers_.push_back(handler);
if (this->server_ != nullptr) {
this->server_->addHandler(handler);