Skip to content

Commit 337e6b3

Browse files
committed
Don't lose username & password on login failure
1 parent caa7f81 commit 337e6b3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎skins/base/views/templates/Login.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ module.exports = React.createClass({
124124
return (
125125
<div>
126126
<form onSubmit={this.onUserPassEntered}>
127-
<input className="mx_Login_field" ref="user" type="text" placeholder="Email or user name" /><br />
128-
<input className="mx_Login_field" ref="pass" type="password" placeholder="Password" /><br />
127+
<input className="mx_Login_field" ref="user" type="text" value={this.state.username} onChange={this.onUsernameChanged} placeholder="Email or user name" /><br />
128+
<input className="mx_Login_field" ref="pass" type="password" value={this.state.password} onChange={this.onPasswordChanged} placeholder="Password" /><br />
129129
{this.componentForStep('choose_hs')}
130130
<input className="mx_Login_submit" type="submit" value="Log in" />
131131
</form>
@@ -134,6 +134,14 @@ module.exports = React.createClass({
134134
}
135135
},
136136

137+
onUsernameChanged: function(ev) {
138+
this.setState({username: ev.target.value});
139+
},
140+
141+
onPasswordChanged: function(ev) {
142+
this.setState({password: ev.target.value});
143+
},
144+
137145
loginContent: function() {
138146
if (this.state.busy) {
139147
return (

0 commit comments

Comments
 (0)