fca-nx 6.8.4 → 6.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -296,48 +296,18 @@ module.exports = function createGetSeqID(deps) {
|
|
|
296
296
|
if (isAuthError) {
|
|
297
297
|
if (retryCount < MAX_RETRIES) {
|
|
298
298
|
const delay = RETRY_DELAY * (retryCount + 1);
|
|
299
|
-
logger(`getSeqID: retry ${retryCount + 1}/${MAX_RETRIES} after ${delay}ms
|
|
299
|
+
logger(`getSeqID: retry ${retryCount + 1}/${MAX_RETRIES} after ${delay}ms, same cookie (error: ${msg})`, "warn");
|
|
300
300
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
301
|
-
|
|
302
|
-
// [Hardened] Always refresh cookies + fb_dtsg before each auth retry
|
|
303
|
-
try {
|
|
304
|
-
logger("getSeqID: refreshing session (cookies + fb_dtsg) before retry...", "info");
|
|
305
|
-
const { get } = require("../../../utils/request");
|
|
306
|
-
const { saveCookies } = require("../../../utils/client");
|
|
307
|
-
await get("https://www.facebook.com/", ctx.jar, null, ctx.globalOptions, ctx).then(saveCookies(ctx.jar));
|
|
308
|
-
if (api && typeof api.refreshFb_dtsg === "function") {
|
|
309
|
-
try { await api.refreshFb_dtsg(); } catch (_) {}
|
|
310
|
-
}
|
|
311
|
-
// Keep form tokens in sync with refreshed ctx
|
|
312
|
-
if (form) {
|
|
313
|
-
if (ctx.fb_dtsg) form.fb_dtsg = ctx.fb_dtsg;
|
|
314
|
-
if (ctx.jazoest) form.jazoest = ctx.jazoest;
|
|
315
|
-
}
|
|
316
|
-
} catch (refreshErr) {
|
|
317
|
-
logger(`getSeqID: session refresh failed: ${refreshErr && refreshErr.message ? refreshErr.message : String(refreshErr)}`, "warn");
|
|
318
|
-
}
|
|
319
|
-
|
|
320
301
|
return getSeqID(defaultFuncs, api, ctx, globalCallback, form, retryCount + 1);
|
|
321
302
|
}
|
|
322
303
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const loginResult = await tryAutoLogin(logger, config, ctx, defaultFuncs);
|
|
326
|
-
|
|
327
|
-
if (loginResult) {
|
|
328
|
-
logger("getSeqID: retrying with new session...", "info");
|
|
329
|
-
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
330
|
-
return getSeqID(defaultFuncs, api, ctx, globalCallback, form, 0);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// [Hardened] Only permanent-logout on CLEAR blocked signal.
|
|
334
|
-
// Plain "Not logged in" after retries is often a transient cookie race —
|
|
335
|
-
// schedule a long soft-reconnect instead of killing the session forever.
|
|
304
|
+
// A new email/password login here kills the cookie the bot is
|
|
305
|
+
// already using and Facebook treats it as a second device.
|
|
336
306
|
if (/blocked the login|login_blocked|checkpoint_282|checkpoint_956/i.test(msg)) {
|
|
337
307
|
return emitAuth(ctx, api, globalCallback, "login_blocked", msg);
|
|
338
308
|
}
|
|
339
309
|
|
|
340
|
-
logger(`getSeqID: auth still failing
|
|
310
|
+
logger(`getSeqID: auth still failing - keeping this cookie, no new login: ${msg}`, "error");
|
|
341
311
|
// Soft recovery: do NOT set ctx._ending. Notify listener, then retry later.
|
|
342
312
|
try {
|
|
343
313
|
if (typeof globalCallback === "function") {
|