Back to Devise Wiki

How To: Not Auto Sign Out After User Edit Profile

How-To:-Not-auto-sign-out-after-user-edit-profile.md

latest519 B
Original Source

http://stackoverflow.com/questions/4264750/devise-logging-out-automatically-after-password-change

def update
  if current_user.update_with_password(params[:user_params])
    bypass_sign_in current_user
    redirect_to root_path, notice: "Password updated successfully!"
  else
    redirect_back(fallback_location: root_path, alert: current_user.errors.full_messages.join(" ").html_safe)
  end
end

If you are using several scopes, specify the one you are signing in:

bypass_sign_in @user, scope: :user