Sha256: 29570633513de6d71869b6f0808062d6835a0cf4949c12e6f8caee1a5ff5e115

Contents?: true

Size: 864 Bytes

Versions: 3

Compression:

Stored size: 864 Bytes

Contents

module Locomotive
  class PasswordsController < ::Devise::PasswordsController

    include Locomotive::Concerns::SslController
    include Locomotive::Concerns::RedirectToMainHostController
    include Locomotive::Concerns::WithinSiteController

    within_site_only_if_existing true

    layout '/locomotive/layouts/account'

    helper Locomotive::BaseHelper

    before_filter :set_locale

    def update
      super do |resource|
        if params[:locomotive_account].try(:[], 'password').blank?
          resource.errors.add_on_blank(:password)
        end
      end
    end

    private

    def after_sending_reset_password_instructions_path_for(resource_name)
      new_locomotive_account_session_path
    end

    def set_locale
      I18n.locale = current_site? ? current_site.accounts.first.locale : Locomotive.config.default_locale
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locomotivecms-3.2.1 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.2.0 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.2.0.rc2 app/controllers/locomotive/passwords_controller.rb