Skip to content

Commit

Permalink
Merge pull request #48 from rzeldent:bugfix/handle_401
Browse files Browse the repository at this point in the history
Add handling for unauthorized
  • Loading branch information
rzeldent authored Mar 19, 2023
2 parents 6a45d99 + 261bca8 commit 6d3e1a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<br><br>The password is incorrect.");
return;
}

Expand Down Expand Up @@ -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<br><br>The password is incorrect.");
return;
}

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 6d3e1a0

Please sign in to comment.