index : matrix-js-sdk

My fork of matrix-js-sdk

diff options
context:
space:
mode:
authorBruno Windels <[email protected]>2020-06-18 14:36:59 +0200
committerBruno Windels <[email protected]>2020-06-18 14:39:16 +0200
commit1fe9dd03a3f45fe5655f9a647c3205d19b9cd936 (patch)
tree8dcb6646922df3c4d4da5c09cbbcabd1c6b097f9
parent75fe596e248cb112100c368a9fd31e9949ed23dd (diff)
downloadmatrix-js-sdk-1fe9dd03a3f45fe5655f9a647c3205d19b9cd936.tar.gz
apparently we call the callback also to obtain flows, so handle that
-rw-r--r--src/crypto/index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/crypto/index.js b/src/crypto/index.js
index 8a632f21..f2a37260 100644
--- a/src/crypto/index.js
+++ b/src/crypto/index.js
@@ -522,8 +522,15 @@ Crypto.prototype.bootstrapSecretStorage = async function({
await this._signObject(crossSigningInfo.keys.master);
await authUploadDeviceSigningKeys(authDict => {
- builder.addCrossSigningKeys(authDict, crossSigningInfo.keys);
- return Promise.resolve();
+ if (authDict) {
+ builder.addCrossSigningKeys(authDict, crossSigningInfo.keys);
+ return Promise.resolve();
+ } else {
+ // This callback also gets called to obtain the IUA flows,
+ // so do a call to obtain those if we don't have the authDict yet
+ // We should get called again at a later point with the authDict.
+ return this._baseApis.uploadDeviceSigningKeys(null, {});
+ }
});
// cross-sign own device