Validate the identity server

This commit is contained in:
Travis Ralston 2018-11-21 14:14:08 -07:00
parent 4cfefe4c3c
commit 5600a9d02a

View file

@ -115,11 +115,6 @@ module.exports = React.createClass({
// discovery went wrong // discovery went wrong
if (this.state.discoveryError) return; if (this.state.discoveryError) return;
if (this.state.discoveredHsUrl) {
console.log("Rewriting username because the homeserver was discovered");
username = username.substring(1).split(":")[0];
}
this.setState({ this.setState({
busy: true, busy: true,
errorText: null, errorText: null,
@ -327,16 +322,13 @@ module.exports = React.createClass({
return; return;
} }
// XXX: We don't verify the identity server URL because sydent doesn't register console.log("Verifying identity server URL: " + isUrl);
// the route we need. const isResponse = await this._getWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);
if (!isResponse) {
// console.log("Verifying identity server URL: " + isUrl); console.error("Invalid /api/v1 response");
// const isResponse = await this._getWellKnownObject(`${isUrl}/_matrix/identity/api/v1`); this.setState({discoveryError: _t("Invalid homeserver discovery response")});
// if (!isResponse) { return;
// console.error("Invalid /api/v1 response"); }
// this.setState({discoveryError: _t("Invalid homeserver discovery response")});
// return;
// }
} }
this.setState({discoveredHsUrl: hsUrl, discoveredIsUrl: isUrl, discoveryError: ""}); this.setState({discoveredHsUrl: hsUrl, discoveredIsUrl: isUrl, discoveryError: ""});