Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/adapter/PhutilAsanaAuthAdapter.php
<?php | <?php | ||||
/** | /** | ||||
* Authentication adapter for Asana OAuth2. | * Authentication adapter for Asana OAuth2. | ||||
*/ | */ | ||||
final class PhutilAsanaAuthAdapter extends PhutilOAuthAuthAdapter { | final class PhutilAsanaAuthAdapter extends PhutilOAuthAuthAdapter { | ||||
public function getAdapterType() { | public function getAdapterType() { | ||||
return 'asana'; | return 'asana'; | ||||
} | } | ||||
public function getAdapterDomain() { | public function getAdapterDomain() { | ||||
return 'asana.com'; | return 'asana.com'; | ||||
} | } | ||||
public function getAccountID() { | public function getAccountID() { | ||||
return $this->getOAuthAccountData('id'); | // See T13453. The Asana API has changed to string IDs and now returns a | ||||
// "gid" field (previously, it returned an "id" field). | |||||
return $this->getOAuthAccountData('gid'); | |||||
} | } | ||||
public function getAccountEmail() { | public function getAccountEmail() { | ||||
return $this->getOAuthAccountData('email'); | return $this->getOAuthAccountData('email'); | ||||
} | } | ||||
public function getAccountName() { | public function getAccountName() { | ||||
return null; | return null; | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |