node-facebook-sdk icon indicating copy to clipboard operation
node-facebook-sdk copied to clipboard

Does not work with current connect versions + Solution

Open andywer opened this issue 13 years ago • 2 comments

Reason: There is no require('connect').utils.serializeCookie() anymore.

Solution: Change the call require('connect').utils.serializeCookie(...) [Line 603] to serializeCookie(...) and declare the following function (taken from an old connect version):

var serializeCookie = function(name, val, obj){
    var pairs = [name + '=' + encodeURIComponent(val)],
        obj = obj || {};

    if (obj.domain) pairs.push('domain=' + obj.domain);
    if (obj.path) pairs.push('path=' + obj.path);
    if (obj.expires) pairs.push('expires=' + obj.expires.toUTCString());
    if (obj.httpOnly) pairs.push('httpOnly');
    if (obj.secure) pairs.push('secure');

    return pairs.join('; ');
};

andywer avatar Sep 23 '12 21:09 andywer

ok, patched locally but heroku still has an automated mode_modules fetching, which always grabs the outdated script from npmjs repos. any clue on that?

cgencer avatar Dec 03 '13 14:12 cgencer

You could use something like this in your package.json:

"repository" :
  { "type" : "git",
    "url" : "http://github.com/cgencer/patched-node-facebook-sdk.git"
  }

(see https://npmjs.org/doc/json.html)

But that's just a work-around. tenorviol would have to apply the modification to the code in his repo.

andywer avatar Dec 03 '13 14:12 andywer