Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php
| Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | protected function synchronizeOAuthAccount( | ||||
| $account->setProperty('oauth.token.access.expires', $expires); | $account->setProperty('oauth.token.access.expires', $expires); | ||||
| } | } | ||||
| public function getOAuthAccessToken( | public function getOAuthAccessToken( | ||||
| PhabricatorExternalAccount $account, | PhabricatorExternalAccount $account, | ||||
| $force_refresh = false) { | $force_refresh = false) { | ||||
| if ($account->getProviderKey() !== $this->getProviderKey()) { | if ($account->getProviderKey() !== $this->getProviderKey()) { | ||||
| throw new Exception("Account does not match provider!"); | throw new Exception('Account does not match provider!'); | ||||
| } | } | ||||
| if (!$force_refresh) { | if (!$force_refresh) { | ||||
| $access_expires = $account->getProperty('oauth.token.access.expires'); | $access_expires = $account->getProperty('oauth.token.access.expires'); | ||||
| $access_token = $account->getProperty('oauth.token.access'); | $access_token = $account->getProperty('oauth.token.access'); | ||||
| // Don't return a token with fewer than this many seconds remaining until | // Don't return a token with fewer than this many seconds remaining until | ||||
| // it expires. | // it expires. | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||