public static API_GitHub_Objects login(this API_GitHub_Objects gitHubObjects, string name, string apiToken) { gitHubObjects.checkIfCanMakeRequest(); try { var Cache = new BasicCacher.BasicCacher(); var Log = new SimpleLogProvider(); var user = new GitModel.GithubUser { Name = name, APIToken = apiToken }; gitHubObjects.ObjectsAPI = new GitAPI.Object(Cache, Log); gitHubObjects.ObjectsAPI.Authenticate(user); gitHubObjects.LoggedIn = true; } catch (Exception ex) { "Error while logging in to GitHub using user {0}".info(name); ex.log("in API_GitHub_Objects.login"); } return(gitHubObjects); }
public static API_GitHub_Objects login(this API_GitHub_Objects gitHubObjects , string name, string apiToken) { gitHubObjects.checkIfCanMakeRequest(); try { var Cache = new BasicCacher.BasicCacher(); var Log = new SimpleLogProvider(); var user = new GitModel.GithubUser { Name = name, APIToken = apiToken }; gitHubObjects.ObjectsAPI = new GitAPI.Object(Cache, Log); gitHubObjects.ObjectsAPI.Authenticate(user); gitHubObjects.LoggedIn = true; } catch(Exception ex) { "Error while logging in to GitHub using user {0}".info(name); ex.log("in API_GitHub_Objects.login"); } return gitHubObjects; }