// Dependencies
var request = require('request');

// Define
module.exports = function(jar,url,callback,callbacks) {
  request.post(url,{jar: jar},function(err,res,body) {
    if (err) {
      if (callbacks.failure)
        callbacks.failure(err);
      return console.error('Request failed: ' + err);
    }
    if (res.headers['x-csrf-token'])
      callback(res.headers['x-csrf-token']);
    if (callbacks.failure)
      callbacks.failure('Could not retrieve X-CSRF-TOKEN.');
    return console.error('Could not retrieve X-CSRF-TOKEN.');
  });
};

@@ -383,16 +383,29 @@
 ken'%5D);%0A
+    else %7B%0A  
     if (
@@ -419,24 +419,26 @@
 ks.failure)%0A
+  
       callba
@@ -486,24 +486,26 @@
 KEN.');%0A    
+  
 return conso
@@ -550,16 +550,22 @@
 KEN.');%0A
+    %7D%0A
   %7D);%0A%7D;

Fix callback