diff --git a/packages/rocketchat-custom-oauth/custom_oauth_server.js b/packages/rocketchat-custom-oauth/custom_oauth_server.js index 84abcb7df8b..6517b3891e4 100644 --- a/packages/rocketchat-custom-oauth/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/custom_oauth_server.js @@ -149,6 +149,11 @@ export class CustomOAuth { let identity = self.getIdentity(accessToken); if (identity) { + // Set 'id' to '_id' for any sources that provide it + if (identity._id && !identity.id) { + identity.id = identity._id; + } + // Fix for Reddit if (identity.result) { identity = identity.result; diff --git a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.coffee b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.coffee index d43d4ba16e2..a8e8ce8a5ec 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.coffee +++ b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.coffee @@ -42,6 +42,6 @@ Template.authorize.events Template.authorize.onRendered -> @autorun (c) => - if Meteor.user()?.oauth?.athorizedClients?.indexOf(@data.client_id()) > -1 + if Meteor.user()?.oauth?.authorizedClients?.indexOf(@data.client_id()) > -1 c.stop() $('button[type=submit]').click()