Sha256: 628d6c8ffcf3c828709e3411512e1e8f7fc38969abf0faa8d235f029c25ae998

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 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
      Kaui.tenant_home_path.call
    end

    def after_sign_out_path_for(resource)
      kaui_path
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kaui-0.16.1 app/controllers/kaui/sessions_controller.rb
kaui-0.16.0 app/controllers/kaui/sessions_controller.rb