Use the correct password when sharing a pad to a contact

- Fix #1270;
- Force reload option added.
This commit is contained in:
Fabrice Mouhartem 2024-07-12 17:59:50 +02:00
parent da63f7d51e
commit 1ac0cd3e1d
No known key found for this signature in database
GPG Key ID: 90579C24FD123C93
3 changed files with 8 additions and 3 deletions

View File

@ -2619,7 +2619,8 @@ define([
disableCache: localStorage['CRYPTPAD_STORE|disableCache'],
driveEvents: !rdyCfg.noDrive, //rdyCfg.driveEvents // Boolean
lastVisit: Number(localStorage.lastVisit) || undefined,
blockId: blockId
blockId: blockId,
blockHash: blockHash
};
common.userHash = userHash || LocalStore.getUserHash();

View File

@ -129,6 +129,7 @@ define([
var obj = {
p: msg.content.isTemplate ? ['template'] : undefined,
t: teamNotification || undefined,
f: 1,
pw: msg.content.password || ''
};
common.openURL(Hash.getNewPadURL(msg.content.href, obj));

View File

@ -8,7 +8,8 @@ define([
'/common/common-hash.js',
'/common/common-util.js',
'/components/chainpad-crypto/crypto.js',
], function (ApiConfig, Messaging, Hash, Util, Crypto) {
'/common/outer/login-block.js',
], function (ApiConfig, Messaging, Hash, Util, Crypto, Block) {
// Random timeout between 10 and 30 times your sync time (lag + chainpad sync)
var getRandomTimeout = function (ctx) {
@ -265,7 +266,9 @@ define([
}
if (content.password) {
var key = ctx.store.driveSecret.keys.cryptKey;
var uHash = ctx.store.data.blockHash;
var uSecret = Block.parseBlockHash(uHash);
var key = uSecret.keys.symmetric;
content.password = Crypto.encrypt(content.password, key);
}