Fix for login error messages not being sticky

This commit is contained in:
Eric Schultz 2018-07-18 13:05:22 -05:00
parent 501b638449
commit 3073e705f6

View file

@ -68,10 +68,10 @@ export class SessionPageForm extends HoudiniForm {
}
catch(e){
if (e.error) {
f.invalidate(e.error)
f.invalidateFromServer(e.error)
}
else {
f.invalidate(e)
f.invalidateFromServer(e)
}
}
}
@ -99,7 +99,7 @@ class InnerSessionLoginForm extends React.Component<SessionLoginFormProps & Inje
this.form.signinApi = this.props.ApiManager.get(WebUserSignInOut)
}
let errorDiv = !this.form.isValid ? <div className="form-group has-error"><div className="help-block" role="alert">{(this.form as any).error}</div></div> : ''
let errorDiv = !this.form.isValid || this.form.hasServerError ? <div className="form-group has-error"><div className="help-block" role="alert">{this.form.serverError}</div></div> : ''
return <form onSubmit={this.form.onSubmit}>
<BasicField field={this.form.$('email')}