Sha256: 5f473849088a0c7451ff7a010d59e4fb4e24706173a7a9b81900b1fc3170706f

Contents?: true

Size: 794 Bytes

Versions: 3

Compression:

Stored size: 794 Bytes

Contents

module Locomotive
  class SessionsController < ::Devise::SessionsController

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

    within_site_only_if_existing true # Note: do not validate the membership

    layout '/locomotive/layouts/account'

    before_filter :set_locale

    helper Locomotive::BaseHelper

    private

    def after_sign_in_path_for(resource)
      current_site? ? dashboard_path(current_site) : sites_path
    end

    def after_sign_out_path_for(resource)
      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/sessions_controller.rb
locomotivecms-3.2.0 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.2.0.rc2 app/controllers/locomotive/sessions_controller.rb