1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-05 17:02:07 +03:00

Allow getSecretStorageKey to be async

This commit is contained in:
J. Ryan Stinnett
2019-12-04 17:30:27 +00:00
parent 9fb559307b
commit 5fced642fa
2 changed files with 2 additions and 4 deletions

View File

@@ -215,7 +215,7 @@ function keyFromRecoverySession(session, decryptionKey) {
* @param {function} [opts.cryptoCallbacks.getSecretStorageKey]
* Optional. Function called when an encryption key for secret storage
* is required. One or more keys will be described in the keys object.
* The callback function should return with an array of:
* The callback function should return a promise with an array of:
* [<key name>, <UInt8Array private key>] or null if it cannot provide
* any of the keys.
* Args:

View File

@@ -533,9 +533,7 @@ export default class SecretStorage extends EventEmitter {
throw new Error("No getSecretStorageKey callback supplied");
}
const returned = await Promise.resolve(
this._cryptoCallbacks.getSecretStorageKey({keys}),
);
const returned = await this._cryptoCallbacks.getSecretStorageKey({ keys });
if (!returned) {
throw new Error("getSecretStorageKey callback returned falsey");