Skip to content

Commit 1436329

Browse files
authored
Update PhutilMediaWikiAuthAdapter.php
1 parent 78723e5 commit 1436329

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/oauth/PhutilMediaWikiAuthAdapter.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,17 @@ public function getExtraTokenParameters() {
9898
}
9999

100100
protected function loadOAuthAccountData() {
101-
if ($this->userinfo === null) {
102-
$uri = id(new PhutilURI($this->getMediaWikiURI('rest.php/oauth2/resource/profile')))
103-
->replaceQueryParam('access_token', $this->getAccessToken());
104-
list($body) = id(new HTTPSFuture($uri))->resolvex();
105-
try {
106-
$data = phutil_json_decode($body);
107-
return $data['result'];
108-
} catch (PhutilJSONParserException $ex) {
109-
throw new Exception(
110-
pht(
111-
'Expected valid JSON response from MediaWiki request'),
112-
$ex);
113-
}
114-
}
115-
return $this->userinfo;
101+
$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();
104+
try {
105+
$data = phutil_json_decode($body);
106+
return $data['result'];
107+
} catch (PhutilJSONParserException $ex) {
108+
throw new Exception(
109+
pht(
110+
'Expected valid JSON response from MediaWiki request'),
111+
$ex);
116112
}
117113

118114
protected function willProcessTokenRequestResponse($body) {

0 commit comments

Comments
 (0)