Sha256: ee622f61c06b44e89685451a0ce21ed673bb438a11ad73248ecf4939c1443d5c

Contents?: true

Size: 678 Bytes

Versions: 16

Compression:

Stored size: 678 Bytes

Contents

module Qbrick
  module Cms
    class AccountsController < BackendController
      before_action :authenticate_admin!

      def edit
        @admin = current_admin
      end

      def update_password
        @admin = Admin.find(current_admin.id)
        if @admin.update_with_password(admin_params)
          # Sign in the admin by passing validation in case their password changed
          sign_in @admin, bypass: true
          redirect_to cms_pages_path
        else
          render 'edit'
        end
      end

      private

      def admin_params
        params.required(:admin).permit(:password, :password_confirmation, :current_password)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.7 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.10 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.9 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.8 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.7 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.6 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.5 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.4 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.3 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.2 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.1 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.6.0 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.5.2 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.5.1 app/controllers/qbrick/cms/accounts_controller.rb
qbrick-2.5.0 app/controllers/qbrick/cms/accounts_controller.rb