Module: Sorcery::Controller::Config
- Defined in:
- lib/sorcery/controller.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_logout ⇒ Object
Returns the value of attribute after_logout.
-
.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.
-
.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.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def after_failed_login @after_failed_login end |
.after_login ⇒ Object
Returns the value of attribute after_login.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def after_login @after_login end |
.after_logout ⇒ Object
Returns the value of attribute after_logout.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def after_logout @after_logout end |
.before_logout ⇒ Object
Returns the value of attribute before_logout.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def before_logout @before_logout end |
.cookie_domain ⇒ Object
Returns the value of attribute cookie_domain.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def @cookie_domain end |
.login_sources ⇒ Object
Returns the value of attribute login_sources.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def login_sources @login_sources end |
.not_authenticated_action ⇒ Object
Returns the value of attribute not_authenticated_action.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def not_authenticated_action @not_authenticated_action end |
.save_return_to_url ⇒ Object
Returns the value of attribute save_return_to_url.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def save_return_to_url @save_return_to_url end |
.submodules ⇒ Object
Returns the value of attribute submodules.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def submodules @submodules end |
.user_class ⇒ Object
Returns the value of attribute user_class.
161 162 163 |
# File 'lib/sorcery/controller.rb', line 161 def user_class @user_class end |
Class Method Details
.configure(&blk) ⇒ Object
209 210 211 |
# File 'lib/sorcery/controller.rb', line 209 def configure(&blk) @configure_blk = blk end |
.configure! ⇒ Object
213 214 215 |
# File 'lib/sorcery/controller.rb', line 213 def configure! @configure_blk.call(self) if @configure_blk end |
.init! ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/sorcery/controller.rb', line 177 def init! @defaults = { :@user_class => nil, :@submodules => [], :@not_authenticated_action => :not_authenticated, :@login_sources => [], :@after_login => [], :@after_failed_login => [], :@before_logout => [], :@after_logout => [], :@save_return_to_url => true, :@cookie_domain => nil } end |
.reset! ⇒ Object
Resets all configuration options to their default values.
193 194 195 196 197 |
# File 'lib/sorcery/controller.rb', line 193 def reset! @defaults.each do |k,v| instance_variable_set(k,v) end end |
.update! ⇒ Object
199 200 201 202 203 |
# File 'lib/sorcery/controller.rb', line 199 def update! @defaults.each do |k,v| instance_variable_set(k,v) if !instance_variable_defined?(k) end end |
.user_config(&blk) ⇒ Object
205 206 207 |
# File 'lib/sorcery/controller.rb', line 205 def user_config(&blk) block_given? ? @user_config = blk : @user_config end |