title: How do I keep the user signed in after they update their password using Devise?
body: <p>Whenever a user updates their password, it signs the user out and asks them to sign in again. This is my action</p>
  <code>users_controller.rb</code>
  <pre><code>  def update
      @user = User.find(params[:id])
      if @user.update user_params
        sign_in @user, bypass: true # for some reason Devise signs the user out
        redirect_to @user
  </code></pre>
  <p><a href="http://www.rubydoc.info/github/plataformatec/devise/Devise/Controllers/SignInOut#sign_in-instance_method" rel="nofollow noreferrer">http://www.rubydoc.info/github/plataformatec/devise/Devise/Controllers/SignInOut#sign_in-instance_method</a></p>
  <p>I tried <code>sign_in @user</code>, also, but that didn't work. I tried it without <code>sign_in</code> but that didn't work either. I saw this answer, but it doesn't help: <a href="https://stackoverflow.com/questions/11567732/devise-is-logging-out-users-after-a-password-change">Devise is logging out users after a password change</a>. Updating the user without the password is working OK. (There is some code not shown.)</p>
  <p>Devise 3.4.1.</p>