Module: SimpleTokenAuthentication::Configuration
- Included in:
- SimpleTokenAuthentication
- Defined in:
- lib/simple_token_authentication/configuration.rb
Constant Summary collapse
- @@fallback =
Default configuration
:devise
- @@header_names =
{}
- @@identifiers =
{}
- @@sign_in_token =
false
- @@controller_adapters =
['rails', 'rails_api', 'rails_metal']
- @@model_adapters =
['active_record', 'mongoid']
- @@adapters_dependencies =
{ 'active_record' => 'ActiveRecord::Base', 'mongoid' => 'Mongoid::Document', 'rails' => 'ActionController::Base', 'rails_api' => 'ActionController::API', 'rails_metal' => 'ActionController::Metal' }
- @@skip_devise_trackable =
true
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Allow the default configuration to be overwritten from initializers.
- #parse_options(options) ⇒ Object
Instance Method Details
#configure {|_self| ... } ⇒ Object
Allow the default configuration to be overwritten from initializers
28 29 30 |
# File 'lib/simple_token_authentication/configuration.rb', line 28 def configure yield self if block_given? end |
#parse_options(options) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/simple_token_authentication/configuration.rb', line 32 def () unless [:fallback].presence if [:fallback_to_devise] [:fallback] = :devise elsif [:fallback_to_devise] == false if SimpleTokenAuthentication.fallback == :devise [:fallback] = :none else [:fallback] = SimpleTokenAuthentication.fallback end else [:fallback] = SimpleTokenAuthentication.fallback end end .reject! { |k,v| k == :fallback_to_devise } end |