Allow rocket.chat to oauth again rocket.chat or other meteor apps

pull/9044/head
Aaron Ogle 8 years ago
parent a62d710676
commit 6a7f5c7a95
  1. 7
      packages/rocketchat-custom-oauth/server/custom_oauth_server.js

@ -213,6 +213,13 @@ 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)) {
if (identity.emails[0].address) {
identity.email = identity.emails[0].address;
}
}
}
// console.log 'id:', JSON.stringify identity, null, ' '

Loading…
Cancel
Save