Merge pull request #2942 from matrix-org/travis/simplify-login-form
Always default to the registration form
This commit is contained in:
commit
e8a94ca3cf
2 changed files with 1 additions and 34 deletions
|
@ -249,17 +249,6 @@ 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);
|
||||||
|
|
||||||
|
@ -1973,7 +1962,6 @@ 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()}
|
||||||
|
|
|
@ -58,7 +58,6 @@ 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.
|
||||||
|
@ -69,26 +68,6 @@ module.exports = React.createClass({
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
const serverType = ServerType.getTypeFromHsUrl(this.props.customHsUrl);
|
const serverType = ServerType.getTypeFromHsUrl(this.props.customHsUrl);
|
||||||
|
|
||||||
const customURLsAllowed = !SdkConfig.get()['disable_custom_urls'];
|
|
||||||
let initialPhase = this.getDefaultPhaseForServerType(serverType);
|
|
||||||
if (
|
|
||||||
// if we have these two, skip to the good bit
|
|
||||||
// (they could come in from the URL params in a
|
|
||||||
// registration email link)
|
|
||||||
(this.props.clientSecret && this.props.sessionId) ||
|
|
||||||
// if custom URLs aren't allowed, skip to form
|
|
||||||
!customURLsAllowed ||
|
|
||||||
// if other logic says to, skip to form
|
|
||||||
this.props.skipServerDetails
|
|
||||||
) {
|
|
||||||
// TODO: It would seem we've now added enough conditions here that the initial
|
|
||||||
// phase will _always_ be the form. It's tempting to remove the complexity and
|
|
||||||
// just do that, but we keep tweaking and changing auth, so let's wait until
|
|
||||||
// things settle a bit.
|
|
||||||
// Filed https://github.com/vector-im/riot-web/issues/8886 to track this.
|
|
||||||
initialPhase = PHASE_REGISTRATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
busy: false,
|
busy: false,
|
||||||
errorText: null,
|
errorText: null,
|
||||||
|
@ -111,7 +90,7 @@ module.exports = React.createClass({
|
||||||
hsUrl: this.props.customHsUrl,
|
hsUrl: this.props.customHsUrl,
|
||||||
isUrl: this.props.customIsUrl,
|
isUrl: this.props.customIsUrl,
|
||||||
// Phase of the overall registration dialog.
|
// Phase of the overall registration dialog.
|
||||||
phase: initialPhase,
|
phase: PHASE_REGISTRATION,
|
||||||
flows: null,
|
flows: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue