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:
parent
81d2f2686c
commit
d6bbbcb620
1 changed files with 9 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue