Merge pull request #2675 from jryans/default-hs-to-form
Skip server details on registration with a default HS
This commit is contained in:
commit
ca5c7b03d3
2 changed files with 17 additions and 2 deletions
|
@ -245,6 +245,17 @@ export default React.createClass({
|
||||||
return this.state.defaultIsUrl || "https://vector.im";
|
return this.state.defaultIsUrl || "https://vector.im";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to skip the server details phase of registration and start at the
|
||||||
|
* actual form.
|
||||||
|
* @return {boolean}
|
||||||
|
* If there was a configured default HS or default server name, skip the
|
||||||
|
* the server details.
|
||||||
|
*/
|
||||||
|
skipServerDetailsForRegistration() {
|
||||||
|
return !!this.state.defaultHsUrl;
|
||||||
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
SdkConfig.put(this.props.config);
|
SdkConfig.put(this.props.config);
|
||||||
|
|
||||||
|
@ -1886,6 +1897,7 @@ export default React.createClass({
|
||||||
defaultServerDiscoveryError={this.state.defaultServerDiscoveryError}
|
defaultServerDiscoveryError={this.state.defaultServerDiscoveryError}
|
||||||
defaultHsUrl={this.getDefaultHsUrl()}
|
defaultHsUrl={this.getDefaultHsUrl()}
|
||||||
defaultIsUrl={this.getDefaultIsUrl()}
|
defaultIsUrl={this.getDefaultIsUrl()}
|
||||||
|
skipServerDetails={this.skipServerDetailsForRegistration()}
|
||||||
brand={this.props.config.brand}
|
brand={this.props.config.brand}
|
||||||
customHsUrl={this.getCurrentHsUrl()}
|
customHsUrl={this.getCurrentHsUrl()}
|
||||||
customIsUrl={this.getCurrentIsUrl()}
|
customIsUrl={this.getCurrentIsUrl()}
|
||||||
|
|
|
@ -60,6 +60,7 @@ module.exports = React.createClass({
|
||||||
customIsUrl: PropTypes.string,
|
customIsUrl: PropTypes.string,
|
||||||
defaultHsUrl: PropTypes.string,
|
defaultHsUrl: PropTypes.string,
|
||||||
defaultIsUrl: PropTypes.string,
|
defaultIsUrl: PropTypes.string,
|
||||||
|
skipServerDetails: PropTypes.bool,
|
||||||
brand: PropTypes.string,
|
brand: PropTypes.string,
|
||||||
email: PropTypes.string,
|
email: PropTypes.string,
|
||||||
// registration shouldn't know or care how login is done.
|
// registration shouldn't know or care how login is done.
|
||||||
|
@ -75,8 +76,10 @@ module.exports = React.createClass({
|
||||||
// (they could come in from the URL params in a
|
// (they could come in from the URL params in a
|
||||||
// registration email link)
|
// registration email link)
|
||||||
(this.props.clientSecret && this.props.sessionId) ||
|
(this.props.clientSecret && this.props.sessionId) ||
|
||||||
// or if custom URLs aren't allowed, skip them
|
// if custom URLs aren't allowed, skip to form
|
||||||
!customURLsAllowed
|
!customURLsAllowed ||
|
||||||
|
// if other logic says to, skip to form
|
||||||
|
this.props.skipServerDetails
|
||||||
) {
|
) {
|
||||||
initialPhase = PHASE_REGISTRATION;
|
initialPhase = PHASE_REGISTRATION;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue