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; }