Don't lose username & password on login failure

pull/1/head
David Baker 2015-07-19 18:00:46 -04:00
parent caa7f813eb
commit 337e6b329f
1 changed files with 10 additions and 2 deletions

View File

@ -124,8 +124,8 @@ module.exports = React.createClass({
return (
<div>
<form onSubmit={this.onUserPassEntered}>
<input className="mx_Login_field" ref="user" type="text" placeholder="Email or user name" /><br />
<input className="mx_Login_field" ref="pass" type="password" placeholder="Password" /><br />
<input className="mx_Login_field" ref="user" type="text" value={this.state.username} onChange={this.onUsernameChanged} placeholder="Email or user name" /><br />
<input className="mx_Login_field" ref="pass" type="password" value={this.state.password} onChange={this.onPasswordChanged} placeholder="Password" /><br />
{this.componentForStep('choose_hs')}
<input className="mx_Login_submit" type="submit" value="Log in" />
</form>
@ -134,6 +134,14 @@ module.exports = React.createClass({
}
},
onUsernameChanged: function(ev) {
this.setState({username: ev.target.value});
},
onPasswordChanged: function(ev) {
this.setState({password: ev.target.value});
},
loginContent: function() {
if (this.state.busy) {
return (