You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Use requestSecret on the client to request secrets
Rather than accessing private method to get the secret storage object (this was a bit confusing when I grepped for 'requestSecret' and didn't find anything).
This commit is contained in:
@@ -69,6 +69,7 @@ describe("self-verifications", () => {
|
||||
_crossSigningInfo,
|
||||
_secretStorage,
|
||||
},
|
||||
requestSecret: _secretStorage.request.bind(_secretStorage),
|
||||
getUserId: () => userId,
|
||||
};
|
||||
|
||||
|
||||
@@ -204,7 +204,6 @@ export class VerificationBase extends EventEmitter {
|
||||
return new Promise((resolve, reject) => {
|
||||
const client = this._baseApis;
|
||||
const original = client._crypto._crossSigningInfo;
|
||||
const storage = client._crypto._secretStorage;
|
||||
|
||||
/* We already have all of the infrastructure we need to validate and
|
||||
* cache cross-signing keys, so instead of replicating that, here we
|
||||
@@ -216,7 +215,7 @@ export class VerificationBase extends EventEmitter {
|
||||
console.debug("VerificationBase.done: requesting secret",
|
||||
type, this.deviceId);
|
||||
const { promise } =
|
||||
storage.request(`m.cross_signing.${type}`, [this.deviceId]);
|
||||
client.requestSecret(`m.cross_signing.${type}`, [this.deviceId]);
|
||||
const result = await promise;
|
||||
const decoded = decodeBase64(result);
|
||||
return Uint8Array.from(decoded);
|
||||
|
||||
Reference in New Issue
Block a user