Fix password issues

pull/1/head
yflory 4 years ago
parent 4f5cb98fd5
commit 9b0f1d186c

@ -467,7 +467,7 @@ define([
currentPad.href = parsed.getUrl(opts); currentPad.href = parsed.getUrl(opts);
currentPad.hash = parsed.hashData && parsed.hashData.getHash(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"); stored = (!err && typeof (data) === "string");
})); }));
Cryptpad.getPadAttribute('password', w(function (err, val) { Cryptpad.getPadAttribute('password', w(function (err, val) {
@ -478,6 +478,11 @@ define([
passwordCfg.value = newPadPassword; 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") { if (parsed.type === "file") {
// `isNewChannel` doesn't work for files (not a channel) // `isNewChannel` doesn't work for files (not a channel)
// `getFileSize` is not adapted to channels because of metadata // `getFileSize` is not adapted to channels because of metadata
@ -503,10 +508,6 @@ define([
waitFor.abort(); waitFor.abort();
return; 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? // Wrong password or deleted file?
askPassword(true, passwordCfg); askPassword(true, passwordCfg);
})); }));

Loading…
Cancel
Save