From 10377b42e9177a3a66475d9fb469237fce609cb5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 12 Jun 2019 17:42:09 +0100 Subject: [PATCH] Fix registration with email + non-default HS We were ignoring the hs/is from the query parameters so after clicking the link, the new client tried to use the wrong server. Broken by https://github.com/matrix-org/matrix-react-sdk/pull/2941 Fixes https://github.com/vector-im/riot-web/issues/9659 --- src/components/structures/MatrixChat.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 56cf81b985..2af2c6dccb 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -219,6 +219,18 @@ export default React.createClass({ return {serverConfig: props}; }, + getRegisterServerProperties() { + const props = this.getServerProperties(); + if (this.state.register_hs_url) { + props.hsUrl = this.state.register_hs_url; + } + if (this.state.register_is_url) { + props.isUrl = this.state.register_is_url; + } + + return {serverConfig: props}; + }, + componentWillMount: function() { SdkConfig.put(this.props.config); @@ -1871,7 +1883,7 @@ export default React.createClass({ onLoggedIn={this.onRegistered} onLoginClick={this.onLoginClick} onServerConfigChange={this.onServerConfigChange} - {...this.getServerProperties()} + {...this.getRegisterServerProperties()} /> ); }