Only submit phone number when phone loginType is selected
Otherwise submit a phoneNumber and phoneCountry of `null` (when logging in with email or username). Fixes https://github.com/vector-im/riot-web/issues/4000
This commit is contained in:
parent
ae053e88c7
commit
f5353fcdc5
1 changed files with 11 additions and 2 deletions
|
@ -69,10 +69,19 @@ 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.state.username,
|
||||||
|
this.state.phoneCountry,
|
||||||
|
this.state.phoneNumber,
|
||||||
|
this.state.password,
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.props.onSubmit(
|
this.props.onSubmit(
|
||||||
this.state.username,
|
this.state.username,
|
||||||
this.state.phoneCountry,
|
null,
|
||||||
this.state.phoneNumber,
|
null,
|
||||||
this.state.password,
|
this.state.password,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue