Module: RailsWarden

Defined in:
lib/rails_warden/engine.rb,
lib/rails_warden/manager.rb,
lib/rails_warden/version.rb,
lib/rails_warden/authentication.rb,
lib/rails_warden/rails_settings.rb

Defined Under Namespace

Modules: Authentication Classes: Engine, Manager

Constant Summary collapse

VERSION =
"1.0.0".freeze

Class Method Summary collapse

Class Method Details

.default_user_classObject

Accessor for the default user class for the application :api: public


12
13
14
# File 'lib/rails_warden/rails_settings.rb', line 12

def self.default_user_class
  @default_user_class ||= User
end

.default_user_class=(klass) ⇒ Object

Set the default user class for the application :api: public


6
7
8
# File 'lib/rails_warden/rails_settings.rb', line 6

def self.default_user_class=(klass)
  @default_user_class = klass
end

.unauthenticated_actionObject

Get the action called when there is an unauthenticated failure This is usually an action on a controller The action is called on the failure application. This would normally be A rails controller

Example

RailsWarden::Manager.new(@app,  :failure_app  => "login_controller",
                                 :defaults     => :password,
                                 :unauthenticated_action => :bad_login
                         )

The unauthenticated_action is :bad_login The bad_login action will be called on the LoginController :api: public


49
50
51
# File 'lib/rails_warden/rails_settings.rb', line 49

def self.unauthenticated_action
  @unauthenticated_action ||= "unauthenticated"
end

.unauthenticated_action=(action) ⇒ Object

Get the action called when there is an unauthenticated failure This is usually an action on a controller The action is called on the failure application. This would normally be A rails controller

Example

RailsWarden::Manager.new(@app,  :failure_app  => "login_controller",
                                 :defaults     => :password,
                                 :unauthenticated_action => :bad_login
                         )

The unauthenticated_action is :bad_login The bad_login action will be called on the LoginController :api: public


30
31
32
33
# File 'lib/rails_warden/rails_settings.rb', line 30

def self.unauthenticated_action=(action)
  action = action.to_s if action
  @unauthenticated_action = action
end