Skip to content

Commit

Permalink
Merge pull request #9183 from RocketChat/fix/api-me-only-return-verified
Browse files Browse the repository at this point in the history
Fix/api me only return verified
  • Loading branch information
rodrigok authored Dec 19, 2017
2 parents 7f21b0f + c2e83f8 commit eca674f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/rocketchat-api/server/v1/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ RocketChat.API.v1.addRoute('me', { authRequired: true }, {
'language'
]);

me.email = me.emails.length ? me.emails[0].address : undefined;
const verifiedEmail = me.emails.find((email) => email.verified);

me.email = verifiedEmail ? verifiedEmail.address : undefined;

return RocketChat.API.v1.success(me);
}
Expand Down

0 comments on commit eca674f

Please sign in to comment.