NEW:clear token when account logs out

jira:[for logout]

Change-Id: Iafbdc9244419bb689a9626251064517ec5544c3d
This commit is contained in:
tao wang 2024-10-10 16:40:18 +08:00 committed by Lane.Wei
parent ac4731de6e
commit 6472fbdc6a
3 changed files with 5 additions and 5 deletions

View File

@ -3980,7 +3980,7 @@ void GUI_App::request_user_logout()
{ {
if (m_agent && m_agent->is_user_login()) { if (m_agent && m_agent->is_user_login()) {
// Update data first before showing dialogs // Update data first before showing dialogs
m_agent->user_logout(); m_agent->user_logout(true);
m_agent->set_user_selected_machine(""); m_agent->set_user_selected_machine("");
/* delete old user settings */ /* delete old user settings */
bool transfer_preset_changes = false; bool transfer_preset_changes = false;

View File

@ -929,11 +929,11 @@ bool NetworkAgent::is_user_login()
return ret; return ret;
} }
int NetworkAgent::user_logout() int NetworkAgent::user_logout(bool request)
{ {
int ret = 0; int ret = 0;
if (network_agent && user_logout_ptr) { if (network_agent && user_logout_ptr) {
ret = user_logout_ptr(network_agent); ret = user_logout_ptr(network_agent, request);
if (ret) if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%")%network_agent %ret; BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%")%network_agent %ret;
} }

View File

@ -45,7 +45,7 @@ typedef int (*func_send_message_to_printer)(void *agent, std::string dev_id, std
typedef bool (*func_start_discovery)(void *agent, bool start, bool sending); typedef bool (*func_start_discovery)(void *agent, bool start, bool sending);
typedef int (*func_change_user)(void *agent, std::string user_info); typedef int (*func_change_user)(void *agent, std::string user_info);
typedef bool (*func_is_user_login)(void *agent); typedef bool (*func_is_user_login)(void *agent);
typedef int (*func_user_logout)(void *agent); typedef int (*func_user_logout)(void *agent, bool request);
typedef std::string (*func_get_user_id)(void *agent); typedef std::string (*func_get_user_id)(void *agent);
typedef std::string (*func_get_user_name)(void *agent); typedef std::string (*func_get_user_name)(void *agent);
typedef std::string (*func_get_user_avatar)(void *agent); typedef std::string (*func_get_user_avatar)(void *agent);
@ -164,7 +164,7 @@ public:
bool start_discovery(bool start, bool sending); bool start_discovery(bool start, bool sending);
int change_user(std::string user_info); int change_user(std::string user_info);
bool is_user_login(); bool is_user_login();
int user_logout(); int user_logout(bool request = false);
std::string get_user_id(); std::string get_user_id();
std::string get_user_name(); std::string get_user_name();
std::string get_user_avatar(); std::string get_user_avatar();