Skip auth flow test for signing upload when password present

If we already have an account password to use during secret storage setup, then
it's highly likely that the homeserver accepts passwords for device signing key
upload as well. This change then assumes password auth will work without
checking to avoid a request when the server is under high load.

Fixes https://github.com/vector-im/riot-web/issues/13286
This commit is contained in:
J. Ryan Stinnett 2020-04-22 14:45:50 +01:00
parent 84552048e6
commit 8b397f807f

View file

@ -92,7 +92,15 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
};
this._fetchBackupInfo();
this._queryKeyUploadAuth();
if (this.state.accountPassword) {
// If we have an account password in memory, let's simplify and
// assume it means password auth is also supported for device
// signing key upload as well. This avoids hitting the server to
// test auth flows, which may be slow under high load.
this.state.canUploadKeysWithPasswordOnly = true;
} else {
this._queryKeyUploadAuth();
}
MatrixClientPeg.get().on('crypto.keyBackupStatus', this._onKeyBackupStatusChange);
}