node-ainzfb-new 1.6.2729-test → 1.6.2819-test

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-ainzfb-new",
3
- "version": "1.6.2729-test",
3
+ "version": "1.6.2819-test",
4
4
  "description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.",
5
5
  "scripts": {
6
6
  "test": "mocha",
package/src/getUserID.js CHANGED
@@ -41,10 +41,10 @@ module.exports = function (defaultFuncs, api, ctx) {
41
41
  path: "/home.php",
42
42
  request_id: utils.getGUID()
43
43
  };
44
- var { getAccessToken } = require('../Extra/ExtraAddons');
44
+
45
45
  defaultFuncs
46
- .get("https://www.facebook.com/ajax/typeahead/search.php", ctx.jar, form)
47
- .then(getAccessToken(ctx, defaultFuncs))
46
+ .getv2("https://www.facebook.com/ajax/typeahead/search.php", ctx.jar, form)
47
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
48
48
  .then(function (resData) {
49
49
  if (resData.error) throw resData;
50
50
 
@@ -54,6 +54,7 @@ module.exports = function (defaultFuncs, api, ctx) {
54
54
  })
55
55
  .catch(function (err) {
56
56
  log.error("getUserID", err);
57
+ console.log(err);
57
58
  return callback(err);
58
59
  });
59
60
 
package/utils.js CHANGED
@@ -22,7 +22,8 @@ function getHeaders(url, options, ctx, customHeader) {
22
22
  Origin: "https://www.facebook.com",
23
23
  "User-Agent": options.userAgent,
24
24
  Connection: "keep-alive",
25
- 'sec-fetch-site': 'same-origin'
25
+ "sec-fetch-site": 'same-origin',
26
+ "sec-fetch-mode": 'cors'
26
27
  };
27
28
  if (customHeader) Object.assign(headers, customHeader);
28
29