Module: Authkeeper::GithubAuthApi::Requests::FetchAccessToken

Included in:
Client
Defined in:
app/lib/authkeeper/github_auth_api/requests/fetch_access_token.rb

Instance Method Summary collapse

Instance Method Details

#fetch_access_token(client_id:, client_secret:, code:) ⇒ Object



7
8
9
10
11
12
13
# File 'app/lib/authkeeper/github_auth_api/requests/fetch_access_token.rb', line 7

def fetch_access_token(client_id:, client_secret:, code:)
  post(
    path: 'login/oauth/access_token',
    params: { client_id: client_id, client_secret: client_secret, code: code },
    headers: { 'Accept' => 'application/vnd.github+json', 'X-GitHub-Api-Version' => '2022-11-28' }
  )
end