diff --git a/map/user.cpp b/map/user.cpp index ab7d8c3698..7b1e0def8f 100644 --- a/map/user.cpp +++ b/map/user.cpp @@ -271,7 +271,16 @@ void User::ResetAccessToken() { std::lock_guard lock(m_mutex); m_accessToken.clear(); - GetPlatform().GetSecureStorage().Remove(kMapsMeTokenKey); + m_userName.clear(); + m_userId.clear(); + m_details = {}; + + // Reset all user-bound keys. + std::vector const kKeysToRemove = {{kMapsMeTokenKey, kReviewIdsKey, + kUserNameKey, kUserIdKey}}; + for (auto const & k : kKeysToRemove) + GetPlatform().GetSecureStorage().Remove(k); + NotifySubscribersImpl(); } diff --git a/map/user.hpp b/map/user.hpp index 69246e157c..ed17334a5d 100644 --- a/map/user.hpp +++ b/map/user.hpp @@ -99,10 +99,11 @@ private: std::string m_accessToken; std::string m_userName; std::string m_userId; - mutable std::mutex m_mutex; bool m_authenticationInProgress = false; Details m_details; std::vector> m_subscribers; + + mutable std::mutex m_mutex; }; namespace lightweight