Module: Sorcery::Controller::Config
- Defined in:
- lib/sorcery/controller/config.rb
Class Attribute Summary collapse
-
.after_failed_login ⇒ Object
Returns the value of attribute after_failed_login.
-
.after_login ⇒ Object
Returns the value of attribute after_login.
-
.after_login_lock ⇒ Object
Returns the value of attribute after_login_lock.
-
.after_logout ⇒ Object
Returns the value of attribute after_logout.
-
.after_remember_me ⇒ Object
Returns the value of attribute after_remember_me.
-
.before_logout ⇒ Object
Returns the value of attribute before_logout.
-
.cookie_domain ⇒ Object
Returns the value of attribute cookie_domain.
-
.login_sources ⇒ Object
Returns the value of attribute login_sources.
-
.not_authenticated_action ⇒ Object
Returns the value of attribute not_authenticated_action.
-
.save_return_to_url ⇒ Object
Returns the value of attribute save_return_to_url.
-
.submodules ⇒ Object
Returns the value of attribute submodules.
-
.use_redirect_back_or_to_by_rails ⇒ Object
Returns the value of attribute use_redirect_back_or_to_by_rails.
-
.user_class ⇒ Object
Returns the value of attribute user_class.
Class Method Summary collapse
- .configure(&blk) ⇒ Object
- .configure! ⇒ Object
- .init! ⇒ Object
-
.reset! ⇒ Object
Resets all configuration options to their default values.
- .update! ⇒ Object
- .user_config(&blk) ⇒ Object
Class Attribute Details
.after_failed_login ⇒ Object
Returns the value of attribute after_failed_login.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def after_failed_login @after_failed_login end |
.after_login ⇒ Object
Returns the value of attribute after_login.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def after_login @after_login end |
.after_login_lock ⇒ Object
Returns the value of attribute after_login_lock.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def after_login_lock @after_login_lock end |
.after_logout ⇒ Object
Returns the value of attribute after_logout.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def after_logout @after_logout end |
.after_remember_me ⇒ Object
Returns the value of attribute after_remember_me.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def after_remember_me @after_remember_me end |
.before_logout ⇒ Object
Returns the value of attribute before_logout.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def before_logout @before_logout end |
.cookie_domain ⇒ Object
Returns the value of attribute cookie_domain.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def end |
.login_sources ⇒ Object
Returns the value of attribute login_sources.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def login_sources @login_sources end |
.not_authenticated_action ⇒ Object
Returns the value of attribute not_authenticated_action.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def not_authenticated_action @not_authenticated_action end |
.save_return_to_url ⇒ Object
Returns the value of attribute save_return_to_url.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def save_return_to_url @save_return_to_url end |
.submodules ⇒ Object
Returns the value of attribute submodules.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def submodules @submodules end |
.use_redirect_back_or_to_by_rails ⇒ Object
Returns the value of attribute use_redirect_back_or_to_by_rails.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def use_redirect_back_or_to_by_rails @use_redirect_back_or_to_by_rails end |
.user_class ⇒ Object
Returns the value of attribute user_class.
5 6 7 |
# File 'lib/sorcery/controller/config.rb', line 5 def user_class @user_class end |
Class Method Details
.configure(&blk) ⇒ Object
54 55 56 |
# File 'lib/sorcery/controller/config.rb', line 54 def configure(&blk) @configure_blk = blk end |
.configure! ⇒ Object
58 59 60 |
# File 'lib/sorcery/controller/config.rb', line 58 def configure! @configure_blk&.call(self) end |
.init! ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sorcery/controller/config.rb', line 19 def init! @defaults = { :@user_class => nil, :@submodules => [], :@not_authenticated_action => :not_authenticated, :@login_sources => Set.new, :@after_login => Set.new, :@after_failed_login => Set.new, :@before_logout => Set.new, :@after_logout => Set.new, :@after_remember_me => Set.new, :@save_return_to_url => true, :@cookie_domain => nil, :@use_redirect_back_or_to_by_rails => false, :@after_login_lock => Set.new } end |
.reset! ⇒ Object
Resets all configuration options to their default values.
38 39 40 41 42 |
# File 'lib/sorcery/controller/config.rb', line 38 def reset! @defaults.each do |k, v| instance_variable_set(k, v) end end |
.update! ⇒ Object
44 45 46 47 48 |
# File 'lib/sorcery/controller/config.rb', line 44 def update! @defaults.each do |k, v| instance_variable_set(k, v) unless instance_variable_defined?(k) end end |
.user_config(&blk) ⇒ Object
50 51 52 |
# File 'lib/sorcery/controller/config.rb', line 50 def user_config(&blk) block_given? ? @user_config = blk : @user_config end |