user_impersonate2 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -12
  3. data/Rakefile +6 -4
  4. data/app/controllers/user_impersonate/impersonate_controller.rb +1 -1
  5. data/lib/user_impersonate/version.rb +1 -1
  6. data/test/{dummy → dummy-rails3}/README.rdoc +0 -0
  7. data/test/{dummy → dummy-rails3}/Rakefile +0 -0
  8. data/test/{dummy → dummy-rails3}/app/assets/javascripts/application.js +0 -0
  9. data/test/{dummy → dummy-rails3}/app/assets/javascripts/home.js +0 -0
  10. data/test/{dummy → dummy-rails3}/app/assets/stylesheets/application.css +0 -0
  11. data/test/{dummy → dummy-rails3}/app/assets/stylesheets/home.css +0 -0
  12. data/test/{dummy → dummy-rails3}/app/controllers/application_controller.rb +0 -0
  13. data/test/{dummy → dummy-rails3}/app/controllers/home_controller.rb +0 -0
  14. data/test/{dummy → dummy-rails3}/app/helpers/application_helper.rb +0 -0
  15. data/test/{dummy → dummy-rails3}/app/helpers/home_helper.rb +0 -0
  16. data/test/{dummy → dummy-rails3}/app/models/user.rb +0 -0
  17. data/test/{dummy → dummy-rails3}/app/views/home/index.html.erb +0 -0
  18. data/test/{dummy → dummy-rails3}/app/views/layouts/application.html.erb +0 -0
  19. data/test/{dummy → dummy-rails3}/app/views/user_impersonate/_header.html.erb +0 -0
  20. data/test/{dummy → dummy-rails3}/config.ru +0 -0
  21. data/test/{dummy → dummy-rails3}/config/application.rb +0 -0
  22. data/test/{dummy → dummy-rails3}/config/boot.rb +0 -0
  23. data/test/{dummy → dummy-rails3}/config/database.yml +0 -0
  24. data/test/{dummy → dummy-rails3}/config/environment.rb +0 -0
  25. data/test/{dummy → dummy-rails3}/config/environments/development.rb +0 -0
  26. data/test/{dummy → dummy-rails3}/config/environments/production.rb +0 -0
  27. data/test/{dummy → dummy-rails3}/config/environments/test.rb +0 -0
  28. data/test/{dummy → dummy-rails3}/config/initializers/backtrace_silencers.rb +0 -0
  29. data/test/{dummy → dummy-rails3}/config/initializers/devise.rb +0 -0
  30. data/test/{dummy → dummy-rails3}/config/initializers/inflections.rb +0 -0
  31. data/test/{dummy → dummy-rails3}/config/initializers/mime_types.rb +0 -0
  32. data/test/{dummy → dummy-rails3}/config/initializers/secret_token.rb +0 -0
  33. data/test/{dummy → dummy-rails3}/config/initializers/session_store.rb +0 -0
  34. data/test/{dummy → dummy-rails3}/config/initializers/user_impersonate.rb +0 -0
  35. data/test/{dummy → dummy-rails3}/config/initializers/wrap_parameters.rb +0 -0
  36. data/test/{dummy → dummy-rails3}/config/locales/devise.en.yml +0 -0
  37. data/test/{dummy → dummy-rails3}/config/locales/en.yml +0 -0
  38. data/test/{dummy → dummy-rails3}/config/routes.rb +0 -0
  39. data/test/{dummy → dummy-rails3}/db/development.sqlite3 +0 -0
  40. data/test/{dummy → dummy-rails3}/db/migrate/20120914174453_devise_create_users.rb +0 -0
  41. data/test/{dummy → dummy-rails3}/db/migrate/20120914184123_add_staff_flag_to_users.rb +0 -0
  42. data/test/{dummy → dummy-rails3}/db/schema.rb +0 -0
  43. data/test/{dummy → dummy-rails3}/db/test.sqlite3 +0 -0
  44. data/test/{dummy → dummy-rails3}/lib/tasks/cucumber.rake +0 -0
  45. data/test/dummy-rails3/log/development.log +262 -0
  46. data/test/dummy-rails3/log/test.log +1091 -0
  47. data/test/{dummy → dummy-rails3}/public/404.html +0 -0
  48. data/test/{dummy → dummy-rails3}/public/422.html +0 -0
  49. data/test/{dummy → dummy-rails3}/public/500.html +0 -0
  50. data/test/{dummy → dummy-rails3}/public/favicon.ico +0 -0
  51. data/test/{dummy → dummy-rails3}/script/rails +0 -0
  52. data/test/{dummy → dummy-rails3}/test/fixtures/users.yml +0 -0
  53. data/test/{dummy → dummy-rails3}/test/unit/helpers/home_helper_test.rb +0 -0
  54. data/test/{dummy → dummy-rails3}/test/unit/user_test.rb +0 -0
  55. data/test/dummy-rails4/README.rdoc +261 -0
  56. data/test/dummy-rails4/Rakefile +7 -0
  57. data/test/dummy-rails4/app/assets/javascripts/application.js +15 -0
  58. data/test/dummy-rails4/app/assets/javascripts/home.js +2 -0
  59. data/test/dummy-rails4/app/assets/stylesheets/application.css +16 -0
  60. data/test/dummy-rails4/app/assets/stylesheets/home.css +7 -0
  61. data/test/dummy-rails4/app/controllers/application_controller.rb +3 -0
  62. data/test/dummy-rails4/app/controllers/home_controller.rb +4 -0
  63. data/test/dummy-rails4/app/helpers/application_helper.rb +2 -0
  64. data/test/dummy-rails4/app/helpers/home_helper.rb +2 -0
  65. data/test/dummy-rails4/app/models/user.rb +17 -0
  66. data/test/dummy-rails4/app/views/home/index.html.erb +11 -0
  67. data/test/dummy-rails4/app/views/layouts/application.html.erb +22 -0
  68. data/test/dummy-rails4/app/views/user_impersonate/_header.html.erb +65 -0
  69. data/test/dummy-rails4/config.ru +4 -0
  70. data/test/dummy-rails4/config/application.rb +57 -0
  71. data/test/dummy-rails4/config/boot.rb +10 -0
  72. data/test/dummy-rails4/config/database.yml +25 -0
  73. data/test/dummy-rails4/config/environment.rb +5 -0
  74. data/test/dummy-rails4/config/environments/development.rb +36 -0
  75. data/test/dummy-rails4/config/environments/production.rb +69 -0
  76. data/test/dummy-rails4/config/environments/test.rb +33 -0
  77. data/test/dummy-rails4/config/initializers/backtrace_silencers.rb +7 -0
  78. data/test/dummy-rails4/config/initializers/devise.rb +234 -0
  79. data/test/dummy-rails4/config/initializers/inflections.rb +15 -0
  80. data/test/dummy-rails4/config/initializers/mime_types.rb +5 -0
  81. data/test/dummy-rails4/config/initializers/secret_token.rb +9 -0
  82. data/test/dummy-rails4/config/initializers/session_store.rb +8 -0
  83. data/test/dummy-rails4/config/initializers/user_impersonate.rb +18 -0
  84. data/test/dummy-rails4/config/initializers/wrap_parameters.rb +14 -0
  85. data/test/dummy-rails4/config/locales/devise.en.yml +58 -0
  86. data/test/dummy-rails4/config/locales/en.yml +5 -0
  87. data/test/dummy-rails4/config/routes.rb +8 -0
  88. data/test/dummy-rails4/db/development.sqlite3 +0 -0
  89. data/test/dummy-rails4/db/migrate/20120914174453_devise_create_users.rb +48 -0
  90. data/test/dummy-rails4/db/migrate/20120914184123_add_staff_flag_to_users.rb +5 -0
  91. data/test/dummy-rails4/db/schema.rb +36 -0
  92. data/test/dummy-rails4/db/test.sqlite3 +0 -0
  93. data/test/dummy-rails4/lib/tasks/cucumber.rake +65 -0
  94. data/test/dummy-rails4/log/development.log +27 -0
  95. data/test/dummy-rails4/log/test.log +465 -0
  96. data/test/dummy-rails4/public/404.html +26 -0
  97. data/test/dummy-rails4/public/422.html +26 -0
  98. data/test/dummy-rails4/public/500.html +25 -0
  99. data/test/dummy-rails4/public/favicon.ico +0 -0
  100. data/test/dummy-rails4/script/rails +6 -0
  101. data/test/dummy-rails4/test/fixtures/users.yml +14 -0
  102. data/test/dummy-rails4/test/unit/helpers/home_helper_test.rb +4 -0
  103. data/test/dummy-rails4/test/unit/user_test.rb +7 -0
  104. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  105. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  106. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2625847957ecb8614efc9b58b07cabdf +0 -0
  107. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  108. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  109. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/35f33ae400a6b0b5bf527436a68133b5 +0 -0
  110. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/3b83d2c20dfdb631259eb9d056ea4419 +0 -0
  111. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/40fc2f3d2a468a00e463f1d313cb1683 +0 -0
  112. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/5f1c168e97e274509aa4673eab0d86f6 +0 -0
  113. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/681d1010f98d5ed273e67645c7cb454d +0 -0
  114. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7411b44628aea038332f13f5ed73e073 +0 -0
  115. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/7f14251885cab31b58c878119cbdc199 +0 -0
  116. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8483b329d12e7e986bc5a2204bbcb4f8 +0 -0
  117. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/8ff157af159f38d424ce1367e29760a2 +0 -0
  118. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b6f020b01a84691088a0c459a18f9c7e +0 -0
  119. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  120. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/bdaaf186999b6b59a3063d23b589d307 +0 -0
  121. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  122. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d0cde4ef34755468270bb49c4a3689f1 +0 -0
  123. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  124. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/edbef6e0d0a4742346cf479f2c522eb0 +0 -0
  125. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f1aac9109f5dae028b3c56eb07311208 +0 -0
  126. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  127. data/test/dummy-rails4/tmp/cache/assets/test/sprockets/fd6c8e27b44aa2db77bf0a8b5118bdf8 +0 -0
  128. data/test/functional/impersonate_controller_test.rb +19 -0
  129. data/test/test_helper.rb +18 -4
  130. data/test/test_utils.rb +49 -0
  131. metadata +262 -112
  132. data/test/dummy/log/development.log +0 -751
  133. data/test/dummy/log/test.log +0 -8348
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,57 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require "user_impersonate"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = "utf-8"
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Enable escaping HTML in JSON.
39
+ config.active_support.escape_html_entities_in_json = true
40
+
41
+ # Use SQL instead of Active Record's schema dumper when creating the database.
42
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
43
+ # like if you have constraints or database-specific column types
44
+ # config.active_record.schema_format = :sql
45
+
46
+ # Enable the asset pipeline
47
+ config.assets.enabled = true
48
+
49
+ # Version of your assets, change this if you want to expire all your assets
50
+ config.assets.version = '1.0'
51
+
52
+ # config.user_impersonate.redirect_on_revert = proc { |env| "/#testing" }
53
+
54
+ config.i18n.enforce_available_locales = true
55
+ end
56
+ end
57
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,36 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ config.eager_load = false
10
+
11
+ # Show full error reports and disable caching
12
+ config.consider_all_requests_local = true
13
+ config.action_controller.perform_caching = false
14
+
15
+ # Don't care if the mailer can't send
16
+ config.action_mailer.raise_delivery_errors = false
17
+
18
+ # Print deprecation notices to the Rails logger
19
+ config.active_support.deprecation = :log
20
+
21
+ # Only use best-standards-support built into browsers
22
+ config.action_dispatch.best_standards_support = :builtin
23
+
24
+ # Log the query plan for queries taking more than this (works
25
+ # with SQLite, MySQL, and PostgreSQL)
26
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
27
+
28
+ # Do not compress assets
29
+ config.assets.compress = false
30
+
31
+ # Expands the lines which load the assets
32
+ config.assets.debug = true
33
+
34
+ # Devise needs a default URL
35
+ config.action_mailer.default_url_options = { host: "localhost:3000" }
36
+ end
@@ -0,0 +1,69 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ config.eager_load = true
12
+
13
+ # Disable Rails's static asset server (Apache or nginx will already do this)
14
+ config.serve_static_assets = false
15
+
16
+ # Compress JavaScripts and CSS
17
+ config.assets.compress = true
18
+
19
+ # Don't fallback to assets pipeline if a precompiled asset is missed
20
+ config.assets.compile = false
21
+
22
+ # Generate digests for assets URLs
23
+ config.assets.digest = true
24
+
25
+ # Defaults to nil and saved in location specified by config.assets.prefix
26
+ # config.assets.manifest = YOUR_PATH
27
+
28
+ # Specifies the header that your server uses for sending files
29
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
30
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
31
+
32
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
33
+ # config.force_ssl = true
34
+
35
+ # See everything in the log (default is :info)
36
+ # config.log_level = :debug
37
+
38
+ # Prepend all log lines with the following tags
39
+ # config.log_tags = [ :subdomain, :uuid ]
40
+
41
+ # Use a different logger for distributed setups
42
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
43
+
44
+ # Use a different cache store in production
45
+ # config.cache_store = :mem_cache_store
46
+
47
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
48
+ # config.action_controller.asset_host = "http://assets.example.com"
49
+
50
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
51
+ # config.assets.precompile += %w( search.js )
52
+
53
+ # Disable delivery errors, bad email addresses will be ignored
54
+ # config.action_mailer.raise_delivery_errors = false
55
+
56
+ # Enable threaded mode
57
+ # config.threadsafe!
58
+
59
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
60
+ # the I18n.default_locale when a translation can not be found)
61
+ config.i18n.fallbacks = true
62
+
63
+ # Send deprecation notices to registered listeners
64
+ config.active_support.deprecation = :notify
65
+
66
+ # Log the query plan for queries taking more than this (works
67
+ # with SQLite, MySQL, and PostgreSQL)
68
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
69
+ end
@@ -0,0 +1,33 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ config.eager_load = false
11
+
12
+ # Configure static asset server for tests with Cache-Control for performance
13
+ config.serve_static_assets = true
14
+ config.static_cache_control = "public, max-age=3600"
15
+
16
+ # Show full error reports and disable caching
17
+ config.consider_all_requests_local = true
18
+ config.action_controller.perform_caching = false
19
+
20
+ # Raise exceptions instead of rendering exception templates
21
+ config.action_dispatch.show_exceptions = false
22
+
23
+ # Disable request forgery protection in test environment
24
+ config.action_controller.allow_forgery_protection = false
25
+
26
+ # Tell Action Mailer not to deliver emails to the real world.
27
+ # The :test delivery method accumulates sent emails in the
28
+ # ActionMailer::Base.deliveries array.
29
+ config.action_mailer.delivery_method = :test
30
+
31
+ # Print deprecation notices to the stderr
32
+ config.active_support.deprecation = :stderr
33
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,234 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ config.secret_key = '01eb4ee1058fbb93635f8c0dd4547fe7258ada2417f50d0dcb05a007afe279de9cfa4eb6cfea55284b23e403b5584c78ea745b40d7341cff88b8ee781a0ce211'
5
+
6
+ # ==> Mailer Configuration
7
+ # Configure the e-mail address which will be shown in Devise::Mailer,
8
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
9
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
10
+
11
+ # Configure the class responsible to send e-mails.
12
+ # config.mailer = "Devise::Mailer"
13
+
14
+ # ==> ORM configuration
15
+ # Load and configure the ORM. Supports :active_record (default) and
16
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
17
+ # available as additional gems.
18
+ require 'devise/orm/active_record'
19
+
20
+ # ==> Configuration for any authentication mechanism
21
+ # Configure which keys are used when authenticating a user. The default is
22
+ # just :email. You can configure it to use [:username, :subdomain], so for
23
+ # authenticating a user, both parameters are required. Remember that those
24
+ # parameters are used only when authenticating and not when retrieving from
25
+ # session. If you need permissions, you should implement that in a before filter.
26
+ # You can also supply a hash where the value is a boolean determining whether
27
+ # or not authentication should be aborted when the value is not present.
28
+ # config.authentication_keys = [ :email ]
29
+
30
+ # Configure parameters from the request object used for authentication. Each entry
31
+ # given should be a request method and it will automatically be passed to the
32
+ # find_for_authentication method and considered in your model lookup. For instance,
33
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
34
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
35
+ # config.request_keys = []
36
+
37
+ # Configure which authentication keys should be case-insensitive.
38
+ # These keys will be downcased upon creating or modifying a user and when used
39
+ # to authenticate or find a user. Default is :email.
40
+ config.case_insensitive_keys = [ :email ]
41
+
42
+ # Configure which authentication keys should have whitespace stripped.
43
+ # These keys will have whitespace before and after removed upon creating or
44
+ # modifying a user and when used to authenticate or find a user. Default is :email.
45
+ config.strip_whitespace_keys = [ :email ]
46
+
47
+ # Tell if authentication through request.params is enabled. True by default.
48
+ # It can be set to an array that will enable params authentication only for the
49
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
50
+ # enable it only for database (email + password) authentication.
51
+ # config.params_authenticatable = true
52
+
53
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
54
+ # It can be set to an array that will enable http authentication only for the
55
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
56
+ # enable it only for token authentication.
57
+ # config.http_authenticatable = false
58
+
59
+ # If http headers should be returned for AJAX requests. True by default.
60
+ # config.http_authenticatable_on_xhr = true
61
+
62
+ # The realm used in Http Basic Authentication. "Application" by default.
63
+ # config.http_authentication_realm = "Application"
64
+
65
+ # It will change confirmation, password recovery and other workflows
66
+ # to behave the same regardless if the e-mail provided was right or wrong.
67
+ # Does not affect registerable.
68
+ # config.paranoid = true
69
+
70
+ # By default Devise will store the user in session. You can skip storage for
71
+ # :http_auth and :token_auth by adding those symbols to the array below.
72
+ # Notice that if you are skipping storage for all authentication paths, you
73
+ # may want to disable generating routes to Devise's sessions controller by
74
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
75
+ config.skip_session_storage = [:http_auth]
76
+
77
+ # ==> Configuration for :database_authenticatable
78
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
79
+ # using other encryptors, it sets how many times you want the password re-encrypted.
80
+ #
81
+ # Limiting the stretches to just one in testing will increase the performance of
82
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
83
+ # a value less than 10 in other environments.
84
+ config.stretches = Rails.env.test? ? 1 : 10
85
+
86
+ # Setup a pepper to generate the encrypted password.
87
+ # config.pepper = "d036ee95f1e1660deb589a4b461c274cc7d9176c03d7061b20f3187db9c677ec445a07772b3852faf942348232c73ccf939261aaf8347de02a8afebda5e0fa08"
88
+
89
+ # ==> Configuration for :confirmable
90
+ # A period that the user is allowed to access the website even without
91
+ # confirming his account. For instance, if set to 2.days, the user will be
92
+ # able to access the website for two days without confirming his account,
93
+ # access will be blocked just in the third day. Default is 0.days, meaning
94
+ # the user cannot access the website without confirming his account.
95
+ # config.allow_unconfirmed_access_for = 2.days
96
+
97
+ # If true, requires any email changes to be confirmed (exactly the same way as
98
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
99
+ # db field (see migrations). Until confirmed new email is stored in
100
+ # unconfirmed email column, and copied to email column on successful confirmation.
101
+ config.reconfirmable = true
102
+
103
+ # Defines which key will be used when confirming an account
104
+ # config.confirmation_keys = [ :email ]
105
+
106
+ # ==> Configuration for :rememberable
107
+ # The time the user will be remembered without asking for credentials again.
108
+ # config.remember_for = 2.weeks
109
+
110
+ # If true, extends the user's remember period when remembered via cookie.
111
+ # config.extend_remember_period = false
112
+
113
+ # Options to be passed to the created cookie. For instance, you can set
114
+ # :secure => true in order to force SSL only cookies.
115
+ # config.rememberable_options = {}
116
+
117
+ # ==> Configuration for :validatable
118
+ # Range for password length. Default is 6..128.
119
+ # config.password_length = 6..128
120
+
121
+ # Email regex used to validate email formats. It simply asserts that
122
+ # an one (and only one) @ exists in the given string. This is mainly
123
+ # to give user feedback and not to assert the e-mail validity.
124
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
125
+
126
+ # ==> Configuration for :timeoutable
127
+ # The time you want to timeout the user session without activity. After this
128
+ # time the user will be asked for credentials again. Default is 30 minutes.
129
+ # config.timeout_in = 30.minutes
130
+
131
+ # If true, expires auth token on session timeout.
132
+ # config.expire_auth_token_on_timeout = false
133
+
134
+ # ==> Configuration for :lockable
135
+ # Defines which strategy will be used to lock an account.
136
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
137
+ # :none = No lock strategy. You should handle locking by yourself.
138
+ # config.lock_strategy = :failed_attempts
139
+
140
+ # Defines which key will be used when locking and unlocking an account
141
+ # config.unlock_keys = [ :email ]
142
+
143
+ # Defines which strategy will be used to unlock an account.
144
+ # :email = Sends an unlock link to the user email
145
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
146
+ # :both = Enables both strategies
147
+ # :none = No unlock strategy. You should handle unlocking by yourself.
148
+ # config.unlock_strategy = :both
149
+
150
+ # Number of authentication tries before locking an account if lock_strategy
151
+ # is failed attempts.
152
+ # config.maximum_attempts = 20
153
+
154
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
155
+ # config.unlock_in = 1.hour
156
+
157
+ # ==> Configuration for :recoverable
158
+ #
159
+ # Defines which key will be used when recovering the password for an account
160
+ # config.reset_password_keys = [ :email ]
161
+
162
+ # Time interval you can reset your password with a reset password key.
163
+ # Don't put a too small interval or your users won't have the time to
164
+ # change their passwords.
165
+ config.reset_password_within = 6.hours
166
+
167
+ # ==> Configuration for :encryptable
168
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
169
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
170
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
171
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
172
+ # REST_AUTH_SITE_KEY to pepper)
173
+ # config.encryptor = :sha512
174
+
175
+ # ==> Configuration for :token_authenticatable
176
+ # Defines name of the authentication token params key
177
+ # config.token_authentication_key = :auth_token
178
+
179
+ # ==> Scopes configuration
180
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
181
+ # "users/sessions/new". It's turned off by default because it's slower if you
182
+ # are using only default views.
183
+ # config.scoped_views = false
184
+
185
+ # Configure the default scope given to Warden. By default it's the first
186
+ # devise role declared in your routes (usually :user).
187
+ # config.default_scope = :user
188
+
189
+ # Set this configuration to false if you want /users/sign_out to sign out
190
+ # only the current scope. By default, Devise signs out all scopes.
191
+ # config.sign_out_all_scopes = true
192
+
193
+ # ==> Navigation configuration
194
+ # Lists the formats that should be treated as navigational. Formats like
195
+ # :html, should redirect to the sign in page when the user does not have
196
+ # access, but formats like :xml or :json, should return 401.
197
+ #
198
+ # If you have any extra navigational formats, like :iphone or :mobile, you
199
+ # should add them to the navigational formats lists.
200
+ #
201
+ # The "*/*" below is required to match Internet Explorer requests.
202
+ # config.navigational_formats = ["*/*", :html]
203
+
204
+ # The default HTTP method used to sign out a resource. Default is :delete.
205
+ config.sign_out_via = :delete
206
+
207
+ # ==> OmniAuth
208
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
209
+ # up on your models and hooks.
210
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
211
+
212
+ # ==> Warden configuration
213
+ # If you want to use other strategies, that are not supported by Devise, or
214
+ # change the failure app, you can configure them inside the config.warden block.
215
+ #
216
+ # config.warden do |manager|
217
+ # manager.intercept_401 = false
218
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
219
+ # end
220
+
221
+ # ==> Mountable engine configurations
222
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
223
+ # is mountable, there are some extra configurations to be taken into account.
224
+ # The following options are available, assuming the engine is mounted as:
225
+ #
226
+ # mount MyEngine, at: "/my_engine"
227
+ #
228
+ # The router that invoked `devise_for`, in the example above, would be:
229
+ # config.router_name = :my_engine
230
+ #
231
+ # When using omniauth, Devise cannot automatically set Omniauth path,
232
+ # so you need to do it manually. For the users scope, it would be:
233
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
234
+ end