code_corps v0.0.1 CodeCorps.GitHub.API.User View Source
Used to perform user actions on the github API
Link to this section Summary
Functions
POSTs code and state to GitHub to receive an OAuth token,
then associates the given user with that OAuth token
Requests the currently authenticated user payload from github
Link to this section Functions
Link to this function
connect(user, code, state)
View Source
connect(CodeCorps.User.t(), String.t(), String.t()) :: {:ok, CodeCorps.User.t()} | {:error, Ecto.Changeset.t()} | {:error, CodeCorps.GitHub.api_error_struct()}
POSTs code and state to GitHub to receive an OAuth token,
then associates the given user with that OAuth token.
Also associates any orphaned GithubAppInstallation records matching their
sender_github_id field with the user’s github_id
Also associates any existing tasks and comments to the newly connected user,
based on the user’s github_id
Returns one of the following:
{:ok, %CodeCorps.User{}}{:error, %Ecto.Changeset{}}{:error, GitHub.api_error_struct}
Link to this function
me(access_token, opts \\ [])
View Source
me(String.t(), Keyword.t()) :: {:ok, map()} | {:error, CodeCorps.GitHub.api_error_struct()}
Requests the currently authenticated user payload from github