public void SetAuth(string username, string password, string apitoken) { if (username == null || password == null || apitoken == null) throw new ArgumentNullException(); username = username.Trim(); password = password.Trim(); apitoken = apitoken.Trim(); if (username.Length == 0 || apitoken.Length < 30) throw new ArgumentOutOfRangeException("User or apitoken set to invalid values"); _githubUser = null; _authInfo = null; _configurationOk = null; InvalidateCache(); Settings.SetSetting("username", username); Settings.SetSetting("password", password); Settings.SetSetting("apitoken", apitoken); }
public void ClearAuth() { _githubUser = null; _authInfo = null; _configurationOk = null; InvalidateCache(); Settings.SetSetting("username", ""); Settings.SetSetting("password", ""); Settings.SetSetting("apitoken", ""); }