Skip to content

Commit

Permalink
Merge pull request #9044 from RocketChat/fix/rocketchat-oauth-rocketchat
Browse files Browse the repository at this point in the history
[FIX] Can't use OAuth login against a Rocket.Chat OAuth server
  • Loading branch information
rodrigok authored Dec 8, 2017
2 parents d4a65a9 + 10972da commit 0ee6410
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ export class CustomOAuth {
if (identity.userid && !identity.id) {
identity.id = identity.userid;
}

// Fix when authenticating from a meteor app with 'emails' field
if (!identity.email && (identity.emails && Array.isArray(identity.emails) && identity.emails.length >= 1)) {
identity.email = identity.emails[0].address ? identity.emails[0].address : undefined;
}
}

// console.log 'id:', JSON.stringify identity, null, ' '
Expand Down

0 comments on commit 0ee6410

Please sign in to comment.