From 261bca818cc1aa1618f5e3132f94ac6df7b03ee6 Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Sun, 19 Mar 2023 13:50:21 +0100 Subject: [PATCH] Add handling for unauthorized --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3499637..cb3f09a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -169,7 +169,7 @@ void handle_restart() if (!web_server.authenticate("admin", iotWebConf.getApPasswordParameter()->valueBuffer)) { - web_server.requestAuthentication(); + web_server.requestAuthentication(BASIC_AUTH, APP_TITLE, "401 Unauthorized

The password is incorrect."); return; } @@ -219,7 +219,7 @@ void handle_flash() if (!web_server.authenticate("admin", iotWebConf.getApPasswordParameter()->valueBuffer)) { - web_server.requestAuthentication(); + web_server.requestAuthentication(BASIC_AUTH, APP_TITLE, "401 Unauthorized

The password is incorrect."); return; } @@ -401,7 +401,7 @@ void setup() { iotWebConf.handleConfig(); }); web_server.on("/restart", HTTP_GET, handle_restart); // Camera snapshot - web_server.on("/snapshot", handle_snapshot); + web_server.on("/snapshot", HTTP_GET, handle_snapshot); // Camera flash light web_server.on("/flash", HTTP_GET, handle_flash);