doc fixes and minor code improvement
This commit is contained in:
parent
b1b7215532
commit
4e2397a79d
1 changed files with 6 additions and 3 deletions
|
@ -271,11 +271,12 @@ class _MatrixClientPeg implements IMatrixClientPeg {
|
|||
|
||||
if (creds.olmAccount) {
|
||||
console.log("got a dehydrated account");
|
||||
const pickleKey = creds.pickleKey || "DEFAULT_KEY";
|
||||
opts.deviceToImport = {
|
||||
olmDevice: {
|
||||
pickledAccount: creds.olmAccount.pickle(creds.pickleKey || "DEFAULT_KEY"),
|
||||
pickledAccount: creds.olmAccount.pickle(pickleKey),
|
||||
sessions: [],
|
||||
pickleKey: creds.pickleKey || "DEFAULT_KEY",
|
||||
pickleKey: pickleKey,
|
||||
},
|
||||
userId: creds.userId,
|
||||
deviceId: creds.deviceId,
|
||||
|
@ -293,7 +294,7 @@ class _MatrixClientPeg implements IMatrixClientPeg {
|
|||
|
||||
// set dehydration key after cross-signing gets set up -- we wait until
|
||||
// cross-signing is set up because we want to cross-sign the dehydrated
|
||||
// key
|
||||
// device
|
||||
const origGetSecretStorageKey = opts.cryptoCallbacks.getSecretStorageKey
|
||||
opts.cryptoCallbacks.getSecretStorageKey = async (keyinfo, ssssItemName) => {
|
||||
const [name, key] = await origGetSecretStorageKey(keyinfo, ssssItemName);
|
||||
|
@ -302,6 +303,8 @@ class _MatrixClientPeg implements IMatrixClientPeg {
|
|||
}
|
||||
|
||||
if (creds.rehydrationKey) {
|
||||
// cache the key so that the SSSS prompt tries using it without
|
||||
// prompting the user
|
||||
cacheDehydrationKey(creds.rehydrationKey, creds.rehydrationKeyInfo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue