Sha256: b6c26a9906db255d4a734de8169082165f145b5c32a21fd8fdaf91cf39728e79

Contents?: true

Size: 562 Bytes

Versions: 6

Compression:

Stored size: 562 Bytes

Contents

module Admin
  class AdminUsersController < Admin::BaseController
    mongosteen

    def update_password
      user = resource
      new_password = permitted_params[:password]

      user.password = new_password
      user.password_confirmation = new_password

      if user.save
        if current_admin_user == user
          sign_in(user, bypass: true)
        end
        render nothing: true

      else
        render json: user.errors, status: 500

      end
    end

    protected

      def permitted_params
        params.permit!
      end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ants-0.3.14 app/controllers/admin/admin_users_controller.rb
ants-0.3.13 app/controllers/admin/admin_users_controller.rb
ants-0.3.12 app/controllers/admin/admin_users_controller.rb
ants-0.3.11 app/controllers/admin/admin_users_controller.rb
ants-0.3.10 app/controllers/admin/admin_users_controller.rb
ants-0.3.9 app/controllers/admin/admin_users_controller.rb