1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Twitter node: remove auth requirement on oauth callback routes

Fixes #253
This commit is contained in:
Nick O'Leary 2017-03-15 09:58:14 +00:00
parent a63df3c41d
commit 9be6545739
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 4 additions and 4 deletions

View File

@ -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('<div style="text-align: center; margin-top: 20px; "><a class="btn" id="node-config-twitter-start" href="twitter-credentials/'+twitterConfigNodeId+'/auth?callback='+callback+'" target="_blank">'+clickhere+'</a></div>');
$("#node-config-twitter-row").html('<div style="text-align: center; margin-top: 20px; "><a class="editor-button" id="node-config-twitter-start" href="twitter-credentials/'+twitterConfigNodeId+'/auth?callback='+callback+'" target="_blank">'+clickhere+'</a></div>');
$("#node-config-twitter-start").click(function() {
twitterConfigNodeIntervalId = window.setTimeout(pollTwitterCredentials,2000);
});

View File

@ -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;

View File

@ -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",