From 43a44cf96447dc2e04f0ef936573950df359889e Mon Sep 17 00:00:00 2001 From: foxman69 <52827101+foxman69@users.noreply.github.com> Date: Fri, 16 Aug 2019 02:46:21 +0300 Subject: [PATCH] Authenticate /reset endpoint (#1858) --- code/espurna/web.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/espurna/web.ino b/code/espurna/web.ino index 9f6ac23c..c3e6682f 100644 --- a/code/espurna/web.ino +++ b/code/espurna/web.ino @@ -59,6 +59,12 @@ constexpr const size_t WEB_CONFIG_BUFFER_MAX = 4096; // ----------------------------------------------------------------------------- void _onReset(AsyncWebServerRequest *request) { + + webLog(request); + if (!webAuthenticate(request)) { + return request->requestAuthentication(getSetting("hostname").c_str()); + } + deferredReset(100, CUSTOM_RESET_HTTP); request->send(200); }