Catch any error from queryLogin

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-08-23 16:58:54 +05:30
parent fc169af10f
commit c9319c7c38

View file

@ -44,7 +44,14 @@ export class CompleteSSOLoginViewModel extends ViewModel {
return; return;
} }
const homeserver = await this.platform.settingsStorage.getString("sso_ongoing_login_homeserver"); const homeserver = await this.platform.settingsStorage.getString("sso_ongoing_login_homeserver");
const loginOptions = await this._sessionContainer.queryLogin(homeserver); let loginOptions;
try {
loginOptions = await this._sessionContainer.queryLogin(homeserver);
}
catch (err) {
this._showError(err.message);
return;
}
if (!loginOptions.token) { if (!loginOptions.token) {
const path = this.navigation.pathFrom([this.navigation.segment("session")]); const path = this.navigation.pathFrom([this.navigation.segment("session")]);
this.navigation.applyPath(path); this.navigation.applyPath(path);