Page MenuHomePhabricator

D21028.id50093.diff
No OneTemporary

D21028.id50093.diff

diff --git a/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php b/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php
--- a/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php
+++ b/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php
@@ -13,8 +13,23 @@
return 'google.com';
}
- public function getAccountID() {
- return $this->getAccountEmail();
+ protected function newAccountIdentifiers() {
+ $identifiers = array();
+
+ $account_id = $this->getOAuthAccountData('id');
+ if ($account_id !== null) {
+ $account_id = sprintf(
+ 'id(%s)',
+ $account_id);
+ $identifiers[] = $this->newAccountIdentifier($account_id);
+ }
+
+ $email = $this->getAccountEmail();
+ if ($email !== null) {
+ $identifiers[] = $this->newAccountIdentifier($email);
+ }
+
+ return $identifiers;
}
public function getAccountEmail() {
diff --git a/src/applications/auth/provider/PhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorAuthProvider.php
@@ -204,13 +204,6 @@
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();
$viewer = PhabricatorUser::getOmnipotentUser();

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 11:07 PM (5 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225539
Default Alt Text
D21028.id50093.diff (1 KB)

Event Timeline