Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php
| Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | public function processLoginRequest( | ||||
| } | } | ||||
| $adapter->setCode($code); | $adapter->setCode($code); | ||||
| // NOTE: As a side effect, this will cause the OAuth adapter to request | // NOTE: As a side effect, this will cause the OAuth adapter to request | ||||
| // an access token. | // an access token. | ||||
| try { | try { | ||||
| $account_id = $adapter->getAccountID(); | $identifiers = $adapter->getAccountIdentifiers(); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| // TODO: Handle this in a more user-friendly way. | // TODO: Handle this in a more user-friendly way. | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| if (!strlen($account_id)) { | if (!$identifiers) { | ||||
| $response = $controller->buildProviderErrorResponse( | $response = $controller->buildProviderErrorResponse( | ||||
| $this, | $this, | ||||
| pht( | pht( | ||||
| 'The OAuth provider failed to retrieve an account ID.')); | 'The OAuth provider failed to retrieve an account ID.')); | ||||
| return array($account, $response); | return array($account, $response); | ||||
| } | } | ||||
| return array($this->loadOrCreateAccount($account_id), $response); | return array($this->loadOrCreateAccount($identifiers), $response); | ||||
| } | } | ||||
| public function processEditForm( | public function processEditForm( | ||||
| AphrontRequest $request, | AphrontRequest $request, | ||||
| array $values) { | array $values) { | ||||
| return $this->processOAuthEditForm( | return $this->processOAuthEditForm( | ||||
| $request, | $request, | ||||
| ▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines | |||||