1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 05:42:40 +01:00

Conduit - return primary email if its verified in user methods

Summary: Ref T7263. We need this in the oauth case and otherwise it makes sense to include.

Test Plan: used the conduit console and saw my email address included in the results!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7263

Differential Revision: https://secure.phabricator.com/D11791
This commit is contained in:
Bob Trahan 2015-02-17 14:13:49 -08:00
parent 81d2f2686c
commit d6bbbcb620

View file

@ -23,8 +23,10 @@ abstract class UserConduitAPIMethod extends ConduitAPIMethod {
$primary = $user->loadPrimaryEmail();
if ($primary && $primary->getIsVerified()) {
$email = $primary->getAddress();
$roles[] = 'verified';
} else {
$email = null;
$roles[] = 'unverified';
}
@ -40,6 +42,7 @@ abstract class UserConduitAPIMethod extends ConduitAPIMethod {
'phid' => $user->getPHID(),
'userName' => $user->getUserName(),
'realName' => $user->getRealName(),
'primaryEmail' => $email,
'image' => $user->getProfileImageURI(),
'uri' => PhabricatorEnv::getURI('/p/'.$user->getUsername().'/'),
'roles' => $roles,