Merge pull request #1143 from matrix-org/luke/fix-login-multiple-fields
Only submit phone number when phone loginType is selected
This commit is contained in:
commit
0207f3cc02
1 changed files with 11 additions and 2 deletions
|
@ -69,12 +69,21 @@ class PasswordLogin extends React.Component {
|
||||||
|
|
||||||
onSubmitForm(ev) {
|
onSubmitForm(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
if (this.state.loginType === PasswordLogin.LOGIN_FIELD_PHONE) {
|
||||||
this.props.onSubmit(
|
this.props.onSubmit(
|
||||||
this.state.username,
|
'', // XXX: Synapse breaks if you send null here:
|
||||||
this.state.phoneCountry,
|
this.state.phoneCountry,
|
||||||
this.state.phoneNumber,
|
this.state.phoneNumber,
|
||||||
this.state.password,
|
this.state.password,
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.props.onSubmit(
|
||||||
|
this.state.username,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.state.password,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUsernameChanged(ev) {
|
onUsernameChanged(ev) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue