Skip to content

Commit dd9def6

Browse files
authored
Fix
1 parent d0486f7 commit dd9def6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/oauth/PhutilMediaWikiAuthAdapter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getAccountID() {
5353
}
5454

5555
public function getAccountEmail() {
56-
return idx($this->loadOAuthAccountData(), 'confirmed_email');
56+
return idx($this->loadOAuthAccountData(), 'email');
5757
}
5858

5959
public function getAccountURI() {
@@ -99,8 +99,10 @@ public function getExtraTokenParameters() {
9999

100100
protected function loadOAuthAccountData() {
101101
$uri = id(new PhutilURI($this->getMediaWikiURI('rest.php/oauth2/resource/profile')))
102-
->replaceQueryParam('access_token', $this->getAccessToken());
103-
list($body) = id(new HTTPSFuture($uri))->resolvex();
102+
$future = new HTTPSFuture($uri);
103+
$token_header = sprintf('token %s', $this->getAccessToken());
104+
$future->addHeader('Authorization', $token_header);
105+
list($body) = $future->resolvex();
104106
try {
105107
$data = phutil_json_decode($body);
106108
return $data['result'];

0 commit comments

Comments
 (0)