mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
more fixes - Refactor MQTT subscriptions #173
This commit is contained in:
@@ -62,13 +62,8 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||
auto method = request->method();
|
||||
bool authenticated = false;
|
||||
|
||||
if (method == HTTP_GET) {
|
||||
// special case if there is no command, then default to 'list' which is like info but showing short names
|
||||
if (!input.size()) {
|
||||
input["cmd"] = "list";
|
||||
}
|
||||
} else {
|
||||
// if its a POST then check authentication
|
||||
// if its a POST then check authentication
|
||||
if (method != HTTP_GET) {
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||
Authentication authentication = _securityManager->authenticateRequest(request);
|
||||
authenticated = settings.notoken_api | AuthenticationPredicates::IS_ADMIN(authentication);
|
||||
|
||||
Reference in New Issue
Block a user