From 368dd798832e9443cbdc4ae8003f38cee82bc16b Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 19 Jan 2023 16:34:01 +0100 Subject: [PATCH] Disable user account in integration mode --- www/common/cryptpad-common.js | 1 + www/common/outer/async-store.js | 4 +++- www/common/sframe-common-outer.js | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 2947ee8a4..3f0c9b4c0 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -2529,6 +2529,7 @@ define([ form_seed: localStorage.CP_formSeed, cache: rdyCfg.cache, noDrive: rdyCfg.noDrive, + neverDrive: rdyCfg.neverDrive, disableCache: localStorage['CRYPTPAD_STORE|disableCache'], driveEvents: !rdyCfg.noDrive, //rdyCfg.driveEvents // Boolean lastVisit: Number(localStorage.lastVisit) || undefined diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 901487dbc..7e040ce0b 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -3198,7 +3198,9 @@ define([ // First tab, no user hash, no anon hash and this app doesn't need a drive // ==> don't create a drive - if (data.noDrive && !data.userHash && !data.anonHash) { + // Or "neverDrive" (integration into another platform?) + // ==> don't create a drive + if (data.neverDrive || (data.noDrive && !data.userHash && !data.anonHash)) { return void onNoDrive(clientId, function (obj) { if (obj && obj.error) { // if we can't properly initialize the noDrive mode, use normal mode diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index ca05bfdfb..75b02ad65 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -267,9 +267,10 @@ define([ // We're only going to check if a hash exists in the URL or not. Cryptpad.ready(waitFor(), { noDrive: cfg.noDrive && AppConfig.allowDrivelessMode && currentPad.hash, + neverDrive: cfg.integration, // XXX we may want integration with drive later driveEvents: cfg.driveEvents, cache: Boolean(cfg.cache), - currentPad: currentPad + currentPad: currentPad, }); // Remove the login hash if needed