From 9b0f1d186cca20425256e1a5934af9e1eb2d8880 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 22 Mar 2021 14:01:09 +0100 Subject: [PATCH] Fix password issues --- www/common/sframe-common-outer.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 687d3a54b..8d791c8cd 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -467,7 +467,7 @@ define([ currentPad.href = parsed.getUrl(opts); currentPad.hash = parsed.hashData && parsed.hashData.getHash(opts); } - Cryptpad.getPadAttribute('title', w(function (err, data) { + Cryptpad.getPadAttribute('channel', w(function (err, data) { stored = (!err && typeof (data) === "string"); })); Cryptpad.getPadAttribute('password', w(function (err, val) { @@ -478,6 +478,11 @@ define([ passwordCfg.value = newPadPassword; } + // Pad not stored && password required: always ask for the password + if (!stored && parsed.hashData.password) { + return void askPassword(true, passwordCfg); + } + if (parsed.type === "file") { // `isNewChannel` doesn't work for files (not a channel) // `getFileSize` is not adapted to channels because of metadata @@ -503,10 +508,6 @@ define([ waitFor.abort(); return; } - if (!stored && !parsed.hashData.password) { - // We've received a link without /p/ and it doesn't work without a password: abort - return void todo(); - } // Wrong password or deleted file? askPassword(true, passwordCfg); }));