Skip to content
Snippets Groups Projects
Commit 6811201b authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5668 from RocketChat/zapier-settings

Change Zapier oAuthApp settings to enable it and update the redirectUri
parents 6fa51ed0 cc7ae6d3
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,7 @@ class API extends Restivus { ...@@ -75,6 +75,7 @@ class API extends Restivus {
//Add a try/catch for each much //Add a try/catch for each much
const originalAction = endpoints[method].action; const originalAction = endpoints[method].action;
endpoints[method].action = function() { endpoints[method].action = function() {
this.logger.debug(`${this.request.method.toUpperCase()}: ${this.request.url}`);
let result; let result;
try { try {
result = originalAction.apply(this); result = originalAction.apply(this);
...@@ -92,7 +93,6 @@ class API extends Restivus { ...@@ -92,7 +93,6 @@ class API extends Restivus {
//Allow the endpoints to make usage of the logger which respects the user's settings //Allow the endpoints to make usage of the logger which respects the user's settings
endpoints[method].logger = this.logger; endpoints[method].logger = this.logger;
endpoints[method].method = method.toUpperCase();
}); });
} }
......
...@@ -3,7 +3,7 @@ RocketChat.API.v1.helperMethods.set('getUserFromParams', function _getUserFromPa ...@@ -3,7 +3,7 @@ RocketChat.API.v1.helperMethods.set('getUserFromParams', function _getUserFromPa
const doesntExist = { _doesntExist: true }; const doesntExist = { _doesntExist: true };
let user; let user;
switch (this.method) { switch (this.request.method) {
case 'POST': case 'POST':
case 'PUT': case 'PUT':
if (this.bodyParams.userId && this.bodyParams.userId.trim()) { if (this.bodyParams.userId && this.bodyParams.userId.trim()) {
......
...@@ -2,10 +2,10 @@ if not RocketChat.models.OAuthApps.findOne('zapier') ...@@ -2,10 +2,10 @@ if not RocketChat.models.OAuthApps.findOne('zapier')
RocketChat.models.OAuthApps.insert RocketChat.models.OAuthApps.insert
_id: 'zapier' _id: 'zapier'
name: 'Zapier' name: 'Zapier'
active: false active: true
clientId: 'zapier' clientId: 'zapier'
clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr' clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr'
redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/AppIDAPI/' redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/App32270API/'
_createdAt: new Date _createdAt: new Date
_createdBy: _createdBy:
_id: 'system' _id: 'system'
......
RocketChat.Migrations.add({
version: 81,
up: function() {
RocketChat.models.OAuthApps.update({ _id: 'zapier' }, {
$set: {
active: true,
redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/App32270API/'
}
});
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment