From f26fc245413cae1b5481b5c3aef972d2ef4f1d71 Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Thu, 26 Jan 2017 16:09:30 -0200 Subject: [PATCH 1/2] Set serviceData id based on Rocket.Chat _id --- packages/rocketchat-custom-oauth/custom_oauth_server.js | 5 +++++ 1 file changed, 5 insertions(+) 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; From 649f75c9205b9e3b70731f0276451f7bea39258b Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Thu, 26 Jan 2017 16:09:43 -0200 Subject: [PATCH 2/2] Fix "athorized" typo --- .../oauth/client/oauth2-client.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()