From c22cf7ef1bd893e43165f29f224bbaf15a9dd791 Mon Sep 17 00:00:00 2001 From: Drew Regitsky Date: Tue, 9 Feb 2016 15:50:55 -0800 Subject: [PATCH] fix(plugin-auth): change auth function params --- src/flux/nylas-api.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/flux/nylas-api.coffee b/src/flux/nylas-api.coffee index 1a47c7988..fc9ccba34 100644 --- a/src/flux/nylas-api.coffee +++ b/src/flux/nylas-api.coffee @@ -383,22 +383,22 @@ class NylasAPI # 3. The API request to auth this account to the plugin failed. This may mean that # the plugin server couldn't be reached or failed to respond properly when authing # the account, or that the Nylas API couldn't be reached. - authPlugin: (plugin, account) -> + authPlugin: (pluginId, pluginName, account) -> return @makeRequest({ returnsModel: false, method: "GET", accountId: account.id, - path: "/auth/plugin?client_id=#{plugin.appId}" + path: "/auth/plugin?client_id=#{pluginId}" }).then( (result) => if result.authed return Promise.resolve() else - return @_requestPluginAuth(plugin.name, account).then( -> @makeRequest({ + return @_requestPluginAuth(pluginName, account).then( -> @makeRequest({ returnsModel: false, method: "POST", accountId: account.id, path: "/auth/plugin", - body: JSON.stringify({client_id: plugin.appId}), + body: JSON.stringify({client_id: pluginId}), json: true })) ) @@ -422,12 +422,12 @@ You can review and revoke Offline Access for plugins at any time from Preference ) ) - unauthPlugin: (plugin, account) -> + unauthPlugin: (pluginId, account) -> return @makeRequest({ returnsModel: false, method: "DELETE", accountId: account.id, - path: "/auth/plugin?client_id=#{plugin.appId}" + path: "/auth/plugin?client_id=#{pluginId}" }); module.exports = new NylasAPI()