public static void Save(UserConfiguration userConfig) { Properties.Settings.Default.UserToken = userConfig.Token; Properties.Settings.Default.Save(); ServerCredentials.Create(userConfig); }
public void Login(ServerCredentials.LoginData loginData) { UserConfiguration userConfig = null; if (loginData != null ) { while (loginData != null && userConfig == null) { userConfig = UserManagement.TokenLogin(loginData.Token); if (userConfig == null) { Logger.Log(String_Functions.UppercaseFirst(loginData.Username) + " Failed to Login... Retrying in 5 seconds"); Thread.Sleep(5000); loginData = ServerCredentials.Read(); } } if (userConfig != null) Logger.Log(String_Functions.UppercaseFirst(userConfig.Username) + " Logged in Successfully"); } CurrentUser = userConfig; }
private void LoginMonitor_UserChanged(ServerCredentials.LoginData loginData) { Login(loginData); }