Skip to content

Commit

Permalink
Remote requests: do not logoff if not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed Aug 14, 2024
1 parent 1b0efff commit e3bd43d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/BoardLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,13 +659,15 @@ namespace fabomatic
if (auto result = backend.checkBackendRequest(); result.has_value())
{
const auto &req = result->get();
ESP_LOGI(TAG, "Processing backend request : %s", req->request_type.c_str());
FabUser fu{req->requester, "BACKEND", true, FabUser::UserLevel::FabAdmin};
ESP_LOGI(TAG, "Processing backend request : %s from %s", req->request_type.c_str(), card::uid_str(req->requester).c_str());

if (req->request_type == "start")
{
logout();
if (!authorize(fu.card_uid))
if (!machine.isFree())
{
logout();
}
if (!authorize(req->requester))
{
ESP_LOGE(TAG, "Failure to execute start request from backend");
}
Expand Down

0 comments on commit e3bd43d

Please sign in to comment.