mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
use olm from param
This commit is contained in:
parent
7d6fcfafa8
commit
f58a3ee975
@ -47,7 +47,7 @@ export async function readKey(txn) {
|
|||||||
return new Key(new KeyDescription(keyData.id, keyAccountData), keyData.binaryKey);
|
return new Key(new KeyDescription(keyData.id, keyAccountData), keyData.binaryKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function keyFromCredential(type, credential, storage, cryptoDriver) {
|
export async function keyFromCredential(type, credential, storage, cryptoDriver, olm) {
|
||||||
const keyDescription = await readDefaultKeyDescription(storage);
|
const keyDescription = await readDefaultKeyDescription(storage);
|
||||||
if (!keyDescription) {
|
if (!keyDescription) {
|
||||||
throw new Error("Could not find any secret storage key in account data");
|
throw new Error("Could not find any secret storage key in account data");
|
||||||
@ -56,7 +56,7 @@ export async function keyFromCredential(type, credential, storage, cryptoDriver)
|
|||||||
if (type === "passphrase") {
|
if (type === "passphrase") {
|
||||||
key = await keyFromPassphrase(keyDescription, credential, cryptoDriver);
|
key = await keyFromPassphrase(keyDescription, credential, cryptoDriver);
|
||||||
} else if (type === "recoverykey") {
|
} else if (type === "recoverykey") {
|
||||||
key = keyFromRecoveryKey(this._olm, keyDescription, credential);
|
key = keyFromRecoveryKey(olm, keyDescription, credential);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Invalid type: ${type}`);
|
throw new Error(`Invalid type: ${type}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user