Remove :server.name for custom servers

Custom servers may not be configured such that their domain name === domain part.
This commit is contained in:
Luke Barnard 2017-04-21 16:09:11 +01:00
parent 2b9cb999ba
commit 9c4c706120
2 changed files with 20 additions and 3 deletions

View file

@ -230,6 +230,12 @@ module.exports = React.createClass({
switch (step) {
case 'm.login.password':
const PasswordLogin = sdk.getComponent('login.PasswordLogin');
// HSs that are not matrix.org may not be configured to have their
// domain name === domain part.
let hsDomain = url.parse(this.state.enteredHomeserverUrl).hostname;
if (hsDomain !== 'matrix.org') {
hsDomain = null;
}
return (
<PasswordLogin
onSubmit={this.onPasswordLogin}
@ -241,7 +247,7 @@ module.exports = React.createClass({
onPhoneNumberChanged={this.onPhoneNumberChanged}
onForgotPasswordClick={this.props.onForgotPasswordClick}
loginIncorrect={this.state.loginIncorrect}
hsDomain={url.parse(this.state.enteredHomeserverUrl).hostname}
hsDomain={hsDomain}
/>
);
case 'm.login.cas':