let registering guests either upgrade or create a new account by specifying a new username. fixes https://github.com/vector-im/vector-web/issues/1161
This commit is contained in:
@@ -1033,7 +1033,6 @@ module.exports = React.createClass({
|
||||
idSid={this.state.register_id_sid}
|
||||
email={this.props.startingQueryParams.email}
|
||||
username={this.state.upgradeUsername}
|
||||
disableUsernameChanges={Boolean(this.state.upgradeUsername)}
|
||||
guestAccessToken={this.state.guestAccessToken}
|
||||
defaultHsUrl={this.props.config.default_hs_url}
|
||||
defaultIsUrl={this.props.config.default_is_url}
|
||||
|
||||
@@ -43,7 +43,6 @@ module.exports = React.createClass({
|
||||
email: React.PropTypes.string,
|
||||
username: React.PropTypes.string,
|
||||
guestAccessToken: React.PropTypes.string,
|
||||
disableUsernameChanges: React.PropTypes.bool,
|
||||
// registration shouldn't know or care how login is done.
|
||||
onLoginClick: React.PropTypes.func.isRequired
|
||||
},
|
||||
@@ -108,6 +107,12 @@ module.exports = React.createClass({
|
||||
errorText: "",
|
||||
busy: true
|
||||
});
|
||||
|
||||
if (formVals.username !== this.props.username) {
|
||||
// don't try to upgrade if we changed our username
|
||||
this.registerLogic.setGuestAccessToken(null);
|
||||
}
|
||||
|
||||
this.onProcessingRegistration(this.registerLogic.register(formVals));
|
||||
},
|
||||
|
||||
@@ -205,7 +210,6 @@ module.exports = React.createClass({
|
||||
showEmail={true}
|
||||
defaultUsername={this.props.username}
|
||||
defaultEmail={this.props.email}
|
||||
disableUsernameChanges={this.props.disableUsernameChanges}
|
||||
minPasswordLength={MIN_PASSWORD_LENGTH}
|
||||
onError={this.onFormValidationFailed}
|
||||
onRegisterClick={this.onFormSubmit} />
|
||||
|
||||
Reference in New Issue
Block a user