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