From 9aaa9597a7ddcacc71909dcedca2525bd24ff855 Mon Sep 17 00:00:00 2001 From: jr0me Date: Thu, 8 Aug 2024 21:51:07 +0200 Subject: [PATCH] feat: handle case of token not having a exp time The token will be cleared, and the expiry time will be set to 1 second. Then another authentication attempt will be made. --- src/agent/communicator/src/communicator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agent/communicator/src/communicator.cpp b/src/agent/communicator/src/communicator.cpp index 2c43f9a21b..fa3e54ec05 100644 --- a/src/agent/communicator/src/communicator.cpp +++ b/src/agent/communicator/src/communicator.cpp @@ -58,6 +58,8 @@ namespace communicator else { std::cerr << "Token does not contain an 'exp' claim" << std::endl; + m_token.clear(); + m_tokenExpTimeInSeconds = 1; return boost::beast::http::status::unauthorized; }