minor: use of let instead of var

- To avoid some secrets to live outside their intended scope.
This commit is contained in:
Fabrice Mouhartem 2024-07-19 11:57:40 +02:00
parent 727c9d7b88
commit 750635db4e
No known key found for this signature in database
GPG Key ID: 90579C24FD123C93

View File

@ -266,9 +266,9 @@ define([
}
if (content.password) {
var uHash = ctx.store.data.blockHash;
var uSecret = Block.parseBlockHash(uHash);
var key = uSecret.keys.symmetric;
let uHash = ctx.store.data.blockHash;
let uSecret = Block.parseBlockHash(uHash);
let key = uSecret.keys.symmetric;
content.password = Crypto.encrypt(content.password, key);
}
@ -387,9 +387,9 @@ define([
var channel = content.channel || content.teamChannel;
if (content.password) {
var uHash = ctx.store.data.blockHash;
var uSecret = Block.parseBlockHash(uHash);
var key = uSecret.keys.symmetric;
let uHash = ctx.store.data.blockHash;
let uSecret = Block.parseBlockHash(uHash);
let key = uSecret.keys.symmetric;
content.pw = content.password;
content.password = Crypto.encrypt(content.password, key);
}