Comparing version 0.2.2 to 0.2.3
@@ -13,3 +13,3 @@ var util = require('util') | ||
this.appSecret = secret; | ||
this._verifyTokens = {}; | ||
Transform.call(this, { | ||
@@ -22,3 +22,8 @@ objectMode: false | ||
PubSubConnection.prototype.isVerifyToken = function(token){ | ||
return this._verifyToken==token.toString(); | ||
token = token.toString(); | ||
if(this._verifyTokens[ token]==token){ | ||
delete this._verifyTokens[ token]==token | ||
return true; | ||
} | ||
return false; | ||
}; | ||
@@ -28,3 +33,5 @@ | ||
PubSubConnection.prototype.verifyToken = function(){ | ||
return this._verifyToken = oauth1a.makeNonce(); | ||
this._verifyToken = oauth1a.makeNonce(); | ||
this._verifyTokens[ this._verifyToken] = this._verifyToken; | ||
return this._verifyToken; | ||
}; | ||
@@ -44,2 +51,3 @@ | ||
return function(req, res){ | ||
console.log(_this._verifyTokens, req.query['hub.verify_token']); | ||
if( _this.isVerifyToken( req.query['hub.verify_token'])){ | ||
@@ -56,2 +64,5 @@ res.send( req.query['hub.challenge']); | ||
return function(req, res, next){ | ||
console.log('valid signature',stream.pubsub.isSignatureValid( | ||
req.rawBody, req.get('X-Hub-Signature')); | ||
if( stream.pubsub.isSignatureValid( | ||
@@ -58,0 +69,0 @@ req.rawBody, req.get('X-Hub-Signature')) |
@@ -14,5 +14,3 @@ var stream = require('stream') | ||
, FB_DEFAULT_PAGE_SUBSCRIBED_FIELDS = [ | ||
'feed' | ||
] | ||
@@ -19,0 +17,0 @@ ; |
{ | ||
"name": "socializr", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Read data streams from several social networks.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49028
1745