Hi, I am trying to implement a small httpServer with ESP8266, the first time I call the http page in my browser, it asks me for a username and password as it should be, but when I call the http page again the following times it no longer It asks me for neither the username or password, how can I do so that whenever I call the website it asks me for this information
Here is my code:
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
#ifndef STASSID
#define STASSID "*************"
#define STAPSK "*************"
#endif
const char* host = "alartmatsunami";
const char* update_path = "/firmware";
const char* update_username = "admin";
const char* update_password = "12345678";
const char* ssid = STASSID;
const char* password = STAPSK;
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
void setup(void) {
Serial.begin(115200);
Serial.println();
Serial.println("Booting Sketch...");
WiFi.mode(WIFI_AP_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
WiFi.begin(ssid, password);
Serial.println("WiFi failed, retrying.");
}
MDNS.begin(host);
httpUpdater.setup(&httpServer, update_path, update_username, update_password);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
Serial.printf("HTTPUpdateServer ready! Open http://%s.local%s in your browser and login with username '%s' and password '%s'\n", host, update_path, update_username, update_password);
}
void loop(void) {
httpServer.handleClient();
MDNS.update();
}