facebook-node-sdk
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -35,2 +35,9 @@ var https = require('https'); | ||
BaseFacebook.prototype.sessionNameMap = { | ||
access_token: 'access_token', | ||
user_id: 'user_id', | ||
code: 'code', | ||
state: 'state' | ||
}; | ||
BaseFacebook.prototype.getRequestParam = function(key) { | ||
@@ -934,3 +941,9 @@ if (!this.request) { | ||
delete parts.query; | ||
parts.search = '?' + params.filter(function(param) { return self.shouldRetainParam(param) }).join('&'); | ||
parts.search = ''; | ||
params = params.filter(function(param) { return self.shouldRetainParam(param) }); | ||
if (params.length > 0) { | ||
parts.search = '?' + params.join('&'); | ||
} | ||
} | ||
@@ -937,0 +950,0 @@ |
@@ -33,4 +33,6 @@ var util = require('util'); | ||
if (this.hasSession) { | ||
for (var name in this.request.session) { | ||
this.clearPersistentData(name); | ||
for (var name in this.sessionNameMap) { | ||
if (this.sessionNameMap.hasOwnProperty(name)) { | ||
this.clearPersistentData(this.sessionNameMap[name]); | ||
} | ||
} | ||
@@ -37,0 +39,0 @@ } |
{ | ||
"name": "facebook-node-sdk", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Node.js SDK for the Facebook API", | ||
@@ -5,0 +5,0 @@ "tags": ["facebook"], |
@@ -188,2 +188,18 @@ var path = require('path'); | ||
facebook = new TransientFacebook({ | ||
appId: config.appId, | ||
secret: config.secret, | ||
request: { | ||
connection: { | ||
}, | ||
headers: { | ||
host: 'www.test.com' | ||
}, | ||
url: '/unit-tests.php?state=hoge' | ||
} | ||
}); | ||
currentUrl = facebook.getCurrentUrl(); | ||
assert.equal('http://www.test.com/unit-tests.php', currentUrl); | ||
done = true; | ||
@@ -190,0 +206,0 @@ }, |
@@ -31,2 +31,31 @@ var path = require('path'); | ||
clearAllPersistentData: function(beforeExit, assert) { | ||
var done = false; | ||
beforeExit(function() { assert.ok(done) }); | ||
var app = express.createServer(); | ||
app.configure(function () { | ||
app.use(express.bodyParser()); | ||
app.use(express.cookieParser()); | ||
app.use(express.session({ secret: 'foo bar' })); | ||
app.use(Facebook.middleware(config)); | ||
}); | ||
// Test clearAllPersistentData don't break session | ||
app.get('/', function(req, res) { | ||
req.facebook.clearAllPersistentData(); | ||
if (req.session.cookie) { | ||
res.send('ok'); | ||
} | ||
else { | ||
res.send('ng'); | ||
} | ||
}); | ||
assert.response(app, { url: '/' }, function(res) { | ||
assert.equal(res.body, 'ok'); | ||
done = true; | ||
}); | ||
}, | ||
middleware: function(beforeExit, assert) { | ||
@@ -33,0 +62,0 @@ var done = false; |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
83588
2452
1