Merge pull request #599 from vector-im/bwindels/fix-emsonelogin

Don't fail login if dehydrated devices are not supported
This commit is contained in:
Bruno Windels 2021-11-25 15:46:01 +01:00 committed by GitHub
commit 92bf28e104
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -329,7 +329,16 @@ export class SessionContainer {
request: this._platform.request, request: this._platform.request,
}); });
const olm = await this._olmPromise; const olm = await this._olmPromise;
const encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log); let encryptedDehydratedDevice;
try {
encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log);
} catch (err) {
if (err.name === "HomeServerError") {
log.set("not_supported", true);
} else {
throw err;
}
}
if (encryptedDehydratedDevice) { if (encryptedDehydratedDevice) {
let resolveStageFinish; let resolveStageFinish;
const promiseStageFinish = new Promise(r => resolveStageFinish = r); const promiseStageFinish = new Promise(r => resolveStageFinish = r);