public void RemoveUsername(string username) { if (Usernames.Remove(username)) { if (CurrentUsername == username) { CurrentUsername = string.Empty; } CacheableType <string> accountDataCache = getAccountDataCache(username); accountDataCache.SetValue(string.Empty); KeyChainCacheableString credentialDataCache = getCredentialDataCache(username); credentialDataCache.SetValue(string.Empty); saveUsernames(); } }
public RememberMeService() { rememberedUsernamesKeyChain = new KeyChainCacheableString("cp.rememberme", ""); currentUsernameKeyChain = new KeyChainCacheableString("cp.remembermecurrent", ""); try { Usernames = Service.Get <JsonService>().Deserialize <List <string> >(rememberedUsernamesKeyChain.GetValue()); CurrentUsername = currentUsernameKeyChain.GetValue(); validateStoredUsernames(); } catch { } if (Usernames == null) { Usernames = new List <string>(); } Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionStartedEvent>(onSessionStarted); Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionLogoutEvent>(onLogout); Service.Get <MixLoginCreateService>().OnSoftLoginFailed += onSoftLoginFailed; }