Merge pull request #219 from matrix-org/matthew/fix-guest-upgrade
let registering guests either upgrade or create a new account by spec…
This commit is contained in:
commit
b58a1707cb
3 changed files with 22 additions and 12 deletions
|
@ -1040,7 +1040,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} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue