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.
-
.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.
-
.sinatra_cookie_secret ⇒ Object
Returns the value of attribute sinatra_cookie_secret.
-
.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.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def after_failed_login @after_failed_login end |
.after_login ⇒ Object
Returns the value of attribute after_login.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def after_login @after_login end |
.after_logout ⇒ Object
Returns the value of attribute after_logout.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def after_logout @after_logout end |
.before_logout ⇒ Object
Returns the value of attribute before_logout.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def before_logout @before_logout end |
.login_sources ⇒ Object
Returns the value of attribute login_sources.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def login_sources @login_sources end |
.not_authenticated_action ⇒ Object
Returns the value of attribute not_authenticated_action.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def not_authenticated_action @not_authenticated_action end |
.save_return_to_url ⇒ Object
Returns the value of attribute save_return_to_url.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def save_return_to_url @save_return_to_url end |
.sinatra_cookie_secret ⇒ Object
Returns the value of attribute sinatra_cookie_secret.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def @sinatra_cookie_secret end |
.submodules ⇒ Object
Returns the value of attribute submodules.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def submodules @submodules end |
.user_class ⇒ Object
Returns the value of attribute user_class.
137 138 139 |
# File 'lib/sorcery/controller.rb', line 137 def user_class @user_class end |
Class Method Details
.configure(&blk) ⇒ Object
185 186 187 |
# File 'lib/sorcery/controller.rb', line 185 def configure(&blk) @configure_blk = blk end |
.configure! ⇒ Object
189 190 191 |
# File 'lib/sorcery/controller.rb', line 189 def configure! @configure_blk.call(self) if @configure_blk end |
.init! ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/sorcery/controller.rb', line 153 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, :@sinatra_cookie_secret => 'ch4ng3M3plz' } end |
.reset! ⇒ Object
Resets all configuration options to their default values.
169 170 171 172 173 |
# File 'lib/sorcery/controller.rb', line 169 def reset! @defaults.each do |k,v| instance_variable_set(k,v) end end |
.update! ⇒ Object
175 176 177 178 179 |
# File 'lib/sorcery/controller.rb', line 175 def update! @defaults.each do |k,v| instance_variable_set(k,v) if !instance_variable_defined?(k) end end |
.user_config(&blk) ⇒ Object
181 182 183 |
# File 'lib/sorcery/controller.rb', line 181 def user_config(&blk) block_given? ? @user_config = blk : @user_config end |