Browse Source

Fix bug where saving settings with blank username/password would require auth with blank user/pass

Chris Mullins 8 years ago
parent
commit
6a738e7bab
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/WebServer/MiLightHttpServer.cpp

+ 3 - 3
lib/WebServer/MiLightHttpServer.cpp

@@ -105,10 +105,10 @@ void MiLightHttpServer::handleDownloadUpdate(const UrlTokenBindings* bindings) {
 }
 
 void MiLightHttpServer::applySettings(Settings& settings) {
-  if (server.authenticationRequired() && !settings.hasAuthSettings()) {
-    server.disableAuthentication();
-  } else {
+  if (settings.hasAuthSettings()) {
     server.requireAuthentication(settings.adminUsername, settings.adminPassword);
+  } else {
+    server.disableAuthentication();
   }
   
   milightClient->setResendCount(settings.packetRepeats);