Require a password to enable OTA mode
authorBuildTools <unconfigured@null.spigotmc.org>
Mon, 8 May 2017 11:07:36 +0000 (12:07 +0100)
committerBuildTools <unconfigured@null.spigotmc.org>
Mon, 8 May 2017 11:07:36 +0000 (12:07 +0100)
door_wiegand.ino

index b2ae15f..ee8b2e0 100644 (file)
@@ -90,10 +90,13 @@ unsigned long ntp_lasttry = 0;
 
 bool ota_enabled = false;
 
-
+/* User requests to enable OTA mode */
 void enable_ota(void)
 {
   if (!ota_enabled) {
+    if (!server.authenticate(www_username, www_password))
+      return server.requestAuthentication();
+      
     Serial.println("Enabling OTA Mode.");
     ArduinoOTA.begin();
     ota_enabled = true;