Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Apr 20, 2022
2 parents e1aed98 + 0e4b82d commit 16ea922
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/takes/facets/auth/social/PsGithub.java
Expand Up @@ -143,11 +143,14 @@ public Response exit(final Response response,
* @throws IOException If fails
*/
private Identity fetch(final String token) throws IOException {
final String uri = new Href(this.api).path("user")
.with(PsGithub.ACCESS_TOKEN, token).toString();
// @checkstyle MethodBodyCommentsCheck (2 lines)
// @checkstyle LineLengthCheck (1 line)
// @see https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/
final String uri = new Href(this.api).path("user").toString();
return PsGithub.parse(
new JdkRequest(uri)
.header("accept", "application/json")
.header("Authorization", String.format("token %s", token))
.fetch().as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(JsonResponse.class).json().readObject()
Expand Down

0 comments on commit 16ea922

Please sign in to comment.