Browse Source

Replace last usage of access_token

Jordi Boggiano 5 years ago
parent
commit
228f08290b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Packagist/WebBundle/Entity/User.php

+ 2 - 2
src/Packagist/WebBundle/Entity/User.php

@@ -233,8 +233,8 @@ class User extends BaseUser implements TwoFactorInterface, BackupCodeInterface
                 return false;
             }
 
-            $ctxt = ['http' => ['header' => ['User-Agent: packagist.org']]];
-            $res = @file_get_contents('https://api.github.com/user?access_token='.$this->githubToken, false, stream_context_create($ctxt));
+            $ctxt = ['http' => ['header' => ['User-Agent: packagist.org', 'Authorization: token '.$this->githubToken]]];
+            $res = @file_get_contents('https://api.github.com/user', false, stream_context_create($ctxt));
             if (!$res || !($res = json_decode($res, true))) {
                 return false;
             }