Sha256: 1f527a92a0798d7c239eeefeb274dfeee8aed90371f1a57aec74b5016a033bff

Contents?: true

Size: 659 Bytes

Versions: 10

Compression:

Stored size: 659 Bytes

Contents

module Kaui
  # Subclassed to specify the correct layout
  class SessionsController < Devise::SessionsController

    layout Kaui.config[:layout]

    skip_before_action :check_for_redirect_to_tenant_screen, raise: false

    protected

    # Override after_sign_in_path_for to not have to rely on the default 'root' config which we want to keep on home#index
    def after_sign_in_path_for(resource)
      # Clear the tenant_id from the cookie to not rely on old cookie data
      session[:kb_tenant_id] = nil
      stored_location_for(:user) || Kaui.tenant_home_path.call
    end

    def after_sign_out_path_for(resource)
      kaui_path
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kaui-2.0.2 app/controllers/kaui/sessions_controller.rb
kaui-2.0.1 app/controllers/kaui/sessions_controller.rb
kaui-2.0.0 app/controllers/kaui/sessions_controller.rb
kaui-1.4.1 app/controllers/kaui/sessions_controller.rb
kaui-1.4.0 app/controllers/kaui/sessions_controller.rb
kaui-1.3.0 app/controllers/kaui/sessions_controller.rb
kaui-1.2.0 app/controllers/kaui/sessions_controller.rb
kaui-1.1.0 app/controllers/kaui/sessions_controller.rb
kaui-1.0.0 app/controllers/kaui/sessions_controller.rb
kaui-0.16.2 app/controllers/kaui/sessions_controller.rb