I have a login form created using React. It uses window.fetch (polyfill) to process the request and react-router to go to the correct page after logging in.
The problem is that Chrome does not offer the ability to save username + password for as long as Firefox, Safari and IE (maybe Opera too).
I am currently testing it on localhost with only http, but I don't think this is a problem.
Here is the code:
doSignIn: function(evt) { evt.preventDefault(); this.context.SignInAction.signIn(evt.target.action, { email: this.credentials.email, password: this.credentials.password }) .then(() => { this.transitionTo('/'); }) .catch((err) => { this.setState({incorrectSignIn: true}); React.findDOMNode(that.refs.email).focus(); }); },
(part of rendering):
<form autoComplete='on' method='POST' action='/site/sign-in' onSubmit={this.doSignIn}> <ul className='signIn'> <li className={classesNotification}>Invalid e-mail or password</li> <li> <input ref='email' type='email' defaultValue={this.credentials.email} placeholder='your e-mail address' required autoFocus='true' /> </li> <li> <input type='password' defaultValue={this.credentials.password} placeholder='password' required /></li> <li><button type='submit'>Sign in</button></li> </ul> </form>
I searched for similar cases, but most of them claimed it was caused by autocomplete=off . This is not the case in my situation.
I also checked the question: Using reactjs and javascript - Chrome does not offer to remember passwords , but this did not help.
Is this a bug in Chrome or do I need to "distribute" my request somehow like a normal message, in order to understand that we are really sending username + password to the server?
Notice that I tried this with three different computers, one local, one from one network and one from a virtual window, and also checked my own autocomplete settings from Chrome. Everything is good from this point of view.
zvona source share