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:
@@ -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';
|
||||
}
|
||||
|
||||
@@ -37,12 +39,13 @@ abstract class UserConduitAPIMethod extends ConduitAPIMethod {
|
||||
}
|
||||
|
||||
$return = array(
|
||||
'phid' => $user->getPHID(),
|
||||
'userName' => $user->getUserName(),
|
||||
'realName' => $user->getRealName(),
|
||||
'image' => $user->getProfileImageURI(),
|
||||
'uri' => PhabricatorEnv::getURI('/p/'.$user->getUsername().'/'),
|
||||
'roles' => $roles,
|
||||
'phid' => $user->getPHID(),
|
||||
'userName' => $user->getUserName(),
|
||||
'realName' => $user->getRealName(),
|
||||
'primaryEmail' => $email,
|
||||
'image' => $user->getProfileImageURI(),
|
||||
'uri' => PhabricatorEnv::getURI('/p/'.$user->getUsername().'/'),
|
||||
'roles' => $roles,
|
||||
);
|
||||
|
||||
if ($current_status) {
|
||||
|
||||
Reference in New Issue
Block a user