This commit is contained in:
Cassie Tarakajian 2016-09-29 22:02:06 -04:00
parent 4d834ed16d
commit 73c3e8e21e
2 changed files with 3 additions and 3 deletions

View file

@ -69,7 +69,7 @@ export function validateAndLoginUser(formProps, dispatch) {
resolve(); resolve();
}) })
.catch(response => { .catch(response => {
reject({ email: response.data.message, _error: 'Login failed!' }); reject({ password: response.data.message, _error: 'Login failed!' });
}); });
}); });
} }

View file

@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
function LoginForm(props) { function LoginForm(props) {
const { fields: { email, password }, handleSubmit, submitting, invalid, pristine } = props; const { fields: { email, password }, handleSubmit, submitting, pristine } = props;
return ( return (
<form className="login-form" onSubmit={handleSubmit(props.validateAndLoginUser.bind(this))}> <form className="login-form" onSubmit={handleSubmit(props.validateAndLoginUser.bind(this))}>
<p className="login-form__field"> <p className="login-form__field">
@ -24,7 +24,7 @@ function LoginForm(props) {
/> />
{password.touched && password.error && <span className="form-error">{password.error}</span>} {password.touched && password.error && <span className="form-error">{password.error}</span>}
</p> </p>
<input type="submit" disabled={submitting || invalid || pristine} value="Login" aria-label="login" /> <input type="submit" disabled={submitting || pristine} value="Login" aria-label="login" />
</form> </form>
); );
} }