Merge pull request #576 from vector-im/bwindels/setup-new-dehydrated-device-when-claiming
Setup new dehydrated device when claiming
This commit is contained in:
commit
d40037ef49
2 changed files with 2 additions and 1 deletions
|
@ -248,6 +248,7 @@ export class SessionContainer {
|
|||
await this._session.load(log);
|
||||
if (dehydratedDevice) {
|
||||
await log.wrap("dehydrateIdentity", log => this._session.dehydrateIdentity(dehydratedDevice, log));
|
||||
await this._session.setupDehydratedDevice(dehydratedDevice.key, log);
|
||||
} else if (!this._session.hasIdentity) {
|
||||
this._status.set(LoadStatus.SessionSetup);
|
||||
await log.wrap("createIdentity", log => this._session.createIdentity(log));
|
||||
|
|
|
@ -36,7 +36,7 @@ export async function uploadAccountAsDehydratedDevice(account, hsApi, key, devic
|
|||
const response = await hsApi.createDehydratedDevice({
|
||||
device_data: {
|
||||
algorithm: DEHYDRATION_LIBOLM_PICKLE_ALGORITHM,
|
||||
account: account.pickleWithKey(key.binaryKey),
|
||||
account: account.pickleWithKey(key.binaryKey.slice()),
|
||||
passphrase: key.description?.passphraseParams || {},
|
||||
},
|
||||
initial_device_display_name: deviceDisplayName
|
||||
|
|
Reference in a new issue