From 9be654573934ddcaa455f991be9897b6806789d2 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 15 Mar 2017 09:58:14 +0000 Subject: [PATCH] Twitter node: remove auth requirement on oauth callback routes Fixes #253 --- social/twitter/27-twitter.html | 2 +- social/twitter/27-twitter.js | 4 ++-- social/twitter/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/social/twitter/27-twitter.html b/social/twitter/27-twitter.html index 1f304a0e..65f7a77b 100644 --- a/social/twitter/27-twitter.html +++ b/social/twitter/27-twitter.html @@ -34,7 +34,7 @@ } var callback = encodeURIComponent(location.protocol+"//"+location.hostname+":"+location.port+pathname+"twitter-credentials/"+twitterConfigNodeId+"/auth/callback"); $("#node-config-dialog-ok").button("disable"); - $("#node-config-twitter-row").html('
'+clickhere+'
'); + $("#node-config-twitter-row").html('
'+clickhere+'
'); $("#node-config-twitter-start").click(function() { twitterConfigNodeIntervalId = window.setTimeout(pollTwitterCredentials,2000); }); diff --git a/social/twitter/27-twitter.js b/social/twitter/27-twitter.js index b3dbbfee..aa9c17f9 100644 --- a/social/twitter/27-twitter.js +++ b/social/twitter/27-twitter.js @@ -459,7 +459,7 @@ module.exports = function(RED) { "HMAC-SHA1" ); - RED.httpAdmin.get('/twitter-credentials/:id/auth', RED.auth.needsPermission('twitter.read'), function(req, res) { + RED.httpAdmin.get('/twitter-credentials/:id/auth', function(req, res) { var credentials = {}; oa.getOAuthRequestToken({ oauth_callback: req.query.callback @@ -478,7 +478,7 @@ module.exports = function(RED) { }); }); - RED.httpAdmin.get('/twitter-credentials/:id/auth/callback', RED.auth.needsPermission('twitter.read'), function(req, res, next) { + RED.httpAdmin.get('/twitter-credentials/:id/auth/callback', function(req, res, next) { var credentials = RED.nodes.getCredentials(req.params.id); credentials.oauth_verifier = req.query.oauth_verifier; diff --git a/social/twitter/package.json b/social/twitter/package.json index 5fb4ac7c..b96f7999 100644 --- a/social/twitter/package.json +++ b/social/twitter/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-twitter", - "version" : "0.1.9", + "version" : "0.1.10", "description" : "A Node-RED node to talk to Twitter", "dependencies" : { "twitter-ng": "0.6.2",