登录表单不提供Chrome上的密码保存

zvo*_*ona 7 javascript forms google-chrome reactjs

我正在使用React创建一个登录表单.它正在使用window.fetch(polyfill)处理请求并react-router在登录后进入正确的页面.

问题是Chrome不提供保存用户名+密码的可能性,而Firefox,Safari和IE确实如此(可能也是Opera).

我目前正在使用仅针对http的localhost进行测试,但我不认为这是问题所在.

这是代码:

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();
  });
},
Run Code Online (Sandbox Code Playgroud)

(渲染部分):

<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>
Run Code Online (Sandbox Code Playgroud)

我寻找类似的案例,但大多数人声称它是由它引起的autocomplete=off.在我的情况下情况并非如此.

我还检查了一个问题:使用reactjs和javascript - Chrome不提供记住密码,但它没有帮助.

这是Chrome中的错误还是我必须以某种方式"传播"我的请求作为普通表单帖子才能让Chrome了解我们实际上是在向服务器发送用户名+密码?

请注意,我已尝试使用三台不同的计算机,一台本地计算机,一台来自同一网络,一台来自虚拟机,还检查了我自己的Chrome自动完成首选项.从这个角度来看,一切都很好.

kia*_*hws 0

Chrome 更新(44.x)后,这个问题显然得到了解决。