Permalink
Browse files

req.query instead of req.params

  • Loading branch information...
1 parent 0981af4 commit c05281e0807c3573ebea6b52adcc81c2cd44b555 @francois2metz committed Nov 19, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/facebook.js
View
@@ -1,8 +1,9 @@
// Express - Facebook - By Dominiek ter Heide (MIT Licensed)
-sys = require('sys')
-hashlib = require('hashlib')
+var sys = require('sys')
+var hashlib = require('hashlib')
+var base64 = require('base64')
function FBSession(userId) {
this.userId = userId;
@@ -50,11 +51,12 @@ exports.Facebook = function(options) {
*/
req.fbAuthenticate = function() {
var cookies = req.cookies;
- var params = req.params;
+ var params = req.query;
// Get a fingerprint and signature
var fingerprint = null;
var signature = null;
+
if(cookies && cookies[apiKey]) {
fingerprint = exports.getFingerprintForCookie(apiKey, cookies)
signature = cookies[apiKey]
@@ -84,7 +86,7 @@ exports.Facebook = function(options) {
if(session && session.userId)
return session;
if(req.fbAuthenticate()) {
- var fbUserId = req.params['fb_sig_user'] ? req.params['fb_sig_user'] : req.cookies[apiKey + '_user']
+ var fbUserId = req.query['fb_sig_user'] ? req.query['fb_sig_user'] : req.cookies[apiKey + '_user']
req.session.fbSession = new FBSession(fbUserId);
return req.session.fbSession;
}

0 comments on commit c05281e

Please sign in to comment.