Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProvider.php
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | if (!$identifiers) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Authentication provider (of class "%s") is attempting to '. | 'Authentication provider (of class "%s") is attempting to '. | ||||
| 'load or create an external account, but provided no account '. | 'load or create an external account, but provided no account '. | ||||
| 'identifiers.', | 'identifiers.', | ||||
| get_class($this))); | get_class($this))); | ||||
| } | } | ||||
| if (count($identifiers) !== 1) { | |||||
| throw new Exception( | |||||
| pht( | |||||
| 'Unexpected number of account identifiers returned (by class "%s").', | |||||
| get_class($this))); | |||||
| } | |||||
| $config = $this->getProviderConfig(); | $config = $this->getProviderConfig(); | ||||
| $viewer = PhabricatorUser::getOmnipotentUser(); | $viewer = PhabricatorUser::getOmnipotentUser(); | ||||
| $raw_identifiers = mpull($identifiers, 'getIdentifierRaw'); | $raw_identifiers = mpull($identifiers, 'getIdentifierRaw'); | ||||
| $accounts = id(new PhabricatorExternalAccountQuery()) | $accounts = id(new PhabricatorExternalAccountQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withProviderConfigPHIDs(array($config->getPHID())) | ->withProviderConfigPHIDs(array($config->getPHID())) | ||||
| ▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines | |||||