Sha256: 8fbe9793336bdb5394a0055b70ac9c485b0178f646706fd9c0d60be30ee15597

Contents?: true

Size: 778 Bytes

Versions: 11

Compression:

Stored size: 778 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
      if current_site?
        I18n.locale = current_site.accounts.first.locale
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
locomotivecms-3.1.2 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.2.0.rc1 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.1.1 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.1.0 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.1.0.rc3 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.1.0.rc2 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.1.0.rc1 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.0.1 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.0.0 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.0.0.rc7 app/controllers/locomotive/sessions_controller.rb
locomotivecms-3.0.0.rc6 app/controllers/locomotive/sessions_controller.rb