Relax identity server discovery error handling

If discovery results in a warning for the identity server (as in can't be found
or is malformed), this allows you to continue signing in and shows the warning
above the form.

Fixes https://github.com/vector-im/riot-web/issues/11102
This commit is contained in:
J. Ryan Stinnett 2019-11-01 10:44:30 +00:00
parent 54cea6a5e3
commit 446e21c2e1
2 changed files with 32 additions and 14 deletions

View file

@ -378,8 +378,19 @@ module.exports = createReactClass({
// Do a quick liveliness check on the URLs
try {
await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl);
this.setState({serverIsAlive: true, errorText: ""});
const { warning } =
await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl);
if (warning) {
this.setState({
...AutoDiscoveryUtils.authComponentStateForError(warning),
errorText: "",
});
} else {
this.setState({
serverIsAlive: true,
errorText: "",
});
}
} catch (e) {
this.setState({
busy: false,