nexus-fca 3.0.4 → 3.0.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/docs/advanced-configuration.md +3 -3
- package/index.js +4 -2
- package/package.json +1 -1
|
@@ -14,8 +14,8 @@ NEXUS_PERSISTENT_DEVICE=true # Enable consistent device fingerprinting (defau
|
|
|
14
14
|
NEXUS_DEVICE_FILE=./device.json # Custom path to device profile file
|
|
15
15
|
|
|
16
16
|
# Single-session guard (built-in)
|
|
17
|
-
# Toggle and configure SingleSessionGuard
|
|
18
|
-
NEXUS_SESSION_LOCK_ENABLED=
|
|
17
|
+
# Toggle and configure SingleSessionGuard (default OFF)
|
|
18
|
+
NEXUS_SESSION_LOCK_ENABLED=false # Enable with true/1 to turn lock ON
|
|
19
19
|
NEXUS_SESSION_LOCK_PATH=./lock # Path to session lock file used by SingleSessionGuard
|
|
20
20
|
NEXUS_FORCE_LOCK=false # Force acquire lock even if lock exists
|
|
21
21
|
|
|
@@ -64,7 +64,7 @@ const api = await login({
|
|
|
64
64
|
persistentDevice: true, // Use consistent device fingerprinting
|
|
65
65
|
deviceFilePath: './device.json', // Custom device profile path
|
|
66
66
|
// Single-session guard (optional toggle)
|
|
67
|
-
sessionLockEnabled: true, //
|
|
67
|
+
sessionLockEnabled: true, // default is OFF; set true or env NEXUS_SESSION_LOCK_ENABLED=true
|
|
68
68
|
|
|
69
69
|
// Connection options
|
|
70
70
|
region: 'NA', // Set fixed region
|
package/index.js
CHANGED
|
@@ -1373,9 +1373,10 @@ async function login(loginData, options = {}, callback) {
|
|
|
1373
1373
|
|
|
1374
1374
|
// STEP 2: Single session guard before starting bot (configurable)
|
|
1375
1375
|
try {
|
|
1376
|
+
const envLockFlag = process.env.NEXUS_SESSION_LOCK_ENABLED;
|
|
1376
1377
|
const lockEnabled = (typeof options.sessionLockEnabled !== 'undefined')
|
|
1377
1378
|
? !!options.sessionLockEnabled
|
|
1378
|
-
:
|
|
1379
|
+
: (envLockFlag === '1' || (envLockFlag || '').toLowerCase() === 'true');
|
|
1379
1380
|
|
|
1380
1381
|
if (lockEnabled) {
|
|
1381
1382
|
const ssg = new SingleSessionGuard({ dataDir: process.env.NEXUS_DATA_DIR });
|
|
@@ -1432,9 +1433,10 @@ async function login(loginData, options = {}, callback) {
|
|
|
1432
1433
|
|
|
1433
1434
|
// Direct session authentication using appstate (with single session guard)
|
|
1434
1435
|
try {
|
|
1436
|
+
const envLockFlag = process.env.NEXUS_SESSION_LOCK_ENABLED;
|
|
1435
1437
|
const lockEnabled = (typeof options.sessionLockEnabled !== 'undefined')
|
|
1436
1438
|
? !!options.sessionLockEnabled
|
|
1437
|
-
:
|
|
1439
|
+
: (envLockFlag === '1' || (envLockFlag || '').toLowerCase() === 'true');
|
|
1438
1440
|
|
|
1439
1441
|
if (lockEnabled) {
|
|
1440
1442
|
const ssg = new SingleSessionGuard({ dataDir: process.env.NEXUS_DATA_DIR });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexus-fca",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Nexus-FCA 3.0 – stable, low-risk Facebook Messenger automation API with integrated secure login (ID / Password / 2FA), adaptive MQTT core, safety orchestration, metrics, and TypeScript support.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|