Skip to content

Commit

Permalink
log accesstoken
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Feb 6, 2024
1 parent 73f18c6 commit 3ca0fa6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ public async Task<IActionResult> HandleAuthorizationCallbackAsync([FromQuery(Nam
}
}

logger.LogInformation("AccessToken: {Token}", accessTokenResponse.AccessToken);

GithubUserResponse? userResponse;
using (HttpRequestMessage requestMessage = new(HttpMethod.Get, "https://api.github.com/user"))
{
requestMessage.Headers.Accept.Add(new("application/vnd.github+json"));
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessTokenResponse.AccessToken);
requestMessage.Headers.Add("X-GitHub-Api-Version", "2022-11-28");

using (HttpResponseMessage responseMessage = await httpClient.SendAsync(requestMessage))
{
Expand Down

0 comments on commit 3ca0fa6

Please sign in to comment.