devise 4.4.3 → 4.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +98 -4
  3. data/MIT-LICENSE +2 -1
  4. data/README.md +96 -59
  5. data/app/controllers/devise/passwords_controller.rb +1 -0
  6. data/app/controllers/devise/registrations_controller.rb +26 -8
  7. data/app/controllers/devise_controller.rb +3 -3
  8. data/app/helpers/devise_helper.rb +21 -18
  9. data/app/mailers/devise/mailer.rb +5 -5
  10. data/app/views/devise/confirmations/new.html.erb +1 -1
  11. data/app/views/devise/passwords/edit.html.erb +3 -3
  12. data/app/views/devise/passwords/new.html.erb +1 -1
  13. data/app/views/devise/registrations/edit.html.erb +4 -4
  14. data/app/views/devise/registrations/new.html.erb +3 -3
  15. data/app/views/devise/sessions/new.html.erb +3 -3
  16. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  17. data/app/views/devise/shared/_links.html.erb +7 -7
  18. data/app/views/devise/unlocks/new.html.erb +1 -1
  19. data/config/locales/en.yml +3 -2
  20. data/lib/devise.rb +4 -4
  21. data/lib/devise/controllers/helpers.rb +8 -8
  22. data/lib/devise/controllers/sign_in_out.rb +6 -3
  23. data/lib/devise/controllers/url_helpers.rb +1 -1
  24. data/lib/devise/failure_app.rb +25 -5
  25. data/lib/devise/hooks/timeoutable.rb +2 -2
  26. data/lib/devise/mapping.rb +1 -1
  27. data/lib/devise/models/authenticatable.rb +44 -45
  28. data/lib/devise/models/confirmable.rb +18 -3
  29. data/lib/devise/models/database_authenticatable.rb +50 -12
  30. data/lib/devise/models/lockable.rb +3 -3
  31. data/lib/devise/models/recoverable.rb +2 -2
  32. data/lib/devise/models/registerable.rb +2 -0
  33. data/lib/devise/models/rememberable.rb +1 -1
  34. data/lib/devise/models/trackable.rb +9 -2
  35. data/lib/devise/models/validatable.rb +1 -1
  36. data/lib/devise/parameter_filter.rb +2 -0
  37. data/lib/devise/parameter_sanitizer.rb +13 -1
  38. data/lib/devise/rails/routes.rb +6 -6
  39. data/lib/devise/secret_key_finder.rb +2 -0
  40. data/lib/devise/strategies/authenticatable.rb +1 -1
  41. data/lib/devise/strategies/database_authenticatable.rb +6 -1
  42. data/lib/devise/test/controller_helpers.rb +4 -2
  43. data/lib/devise/test/integration_helpers.rb +1 -1
  44. data/lib/devise/version.rb +1 -1
  45. data/lib/generators/active_record/devise_generator.rb +9 -9
  46. data/lib/generators/devise/controllers_generator.rb +1 -1
  47. data/lib/generators/devise/devise_generator.rb +1 -1
  48. data/lib/generators/devise/install_generator.rb +1 -5
  49. data/lib/generators/devise/orm_helpers.rb +2 -2
  50. data/lib/generators/devise/views_generator.rb +1 -1
  51. data/lib/generators/mongoid/devise_generator.rb +5 -5
  52. data/lib/generators/templates/README +9 -1
  53. data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +1 -1
  54. data/lib/generators/templates/devise.rb +34 -6
  55. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
  56. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
  57. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
  58. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
  59. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
  60. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
  61. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
  62. metadata +7 -312
  63. data/.gitignore +0 -10
  64. data/.travis.yml +0 -68
  65. data/.yardopts +0 -9
  66. data/CODE_OF_CONDUCT.md +0 -22
  67. data/CONTRIBUTING.md +0 -79
  68. data/Gemfile +0 -39
  69. data/Gemfile.lock +0 -193
  70. data/ISSUE_TEMPLATE.md +0 -19
  71. data/Rakefile +0 -37
  72. data/bin/test +0 -13
  73. data/devise.gemspec +0 -28
  74. data/devise.png +0 -0
  75. data/gemfiles/Gemfile.rails-4.1-stable +0 -32
  76. data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -171
  77. data/gemfiles/Gemfile.rails-4.2-stable +0 -32
  78. data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -192
  79. data/gemfiles/Gemfile.rails-5.0-stable +0 -33
  80. data/gemfiles/Gemfile.rails-5.0-stable.lock +0 -192
  81. data/gemfiles/Gemfile.rails-5.2-rc1 +0 -26
  82. data/gemfiles/Gemfile.rails-5.2-rc1.lock +0 -201
  83. data/guides/bug_report_templates/integration_test.rb +0 -106
  84. data/test/controllers/custom_registrations_controller_test.rb +0 -42
  85. data/test/controllers/custom_strategy_test.rb +0 -66
  86. data/test/controllers/helper_methods_test.rb +0 -24
  87. data/test/controllers/helpers_test.rb +0 -318
  88. data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -53
  89. data/test/controllers/internal_helpers_test.rb +0 -129
  90. data/test/controllers/load_hooks_controller_test.rb +0 -21
  91. data/test/controllers/passwords_controller_test.rb +0 -34
  92. data/test/controllers/sessions_controller_test.rb +0 -108
  93. data/test/controllers/url_helpers_test.rb +0 -67
  94. data/test/delegator_test.rb +0 -21
  95. data/test/devise_test.rb +0 -109
  96. data/test/failure_app_test.rb +0 -340
  97. data/test/generators/active_record_generator_test.rb +0 -130
  98. data/test/generators/controllers_generator_test.rb +0 -50
  99. data/test/generators/devise_generator_test.rb +0 -41
  100. data/test/generators/install_generator_test.rb +0 -26
  101. data/test/generators/mongoid_generator_test.rb +0 -25
  102. data/test/generators/views_generator_test.rb +0 -105
  103. data/test/helpers/devise_helper_test.rb +0 -51
  104. data/test/integration/authenticatable_test.rb +0 -706
  105. data/test/integration/confirmable_test.rb +0 -326
  106. data/test/integration/database_authenticatable_test.rb +0 -97
  107. data/test/integration/http_authenticatable_test.rb +0 -114
  108. data/test/integration/lockable_test.rb +0 -242
  109. data/test/integration/mounted_engine_test.rb +0 -38
  110. data/test/integration/omniauthable_test.rb +0 -148
  111. data/test/integration/recoverable_test.rb +0 -349
  112. data/test/integration/registerable_test.rb +0 -365
  113. data/test/integration/rememberable_test.rb +0 -219
  114. data/test/integration/timeoutable_test.rb +0 -186
  115. data/test/integration/trackable_test.rb +0 -99
  116. data/test/mailers/confirmation_instructions_test.rb +0 -117
  117. data/test/mailers/email_changed_test.rb +0 -132
  118. data/test/mailers/mailer_test.rb +0 -20
  119. data/test/mailers/reset_password_instructions_test.rb +0 -98
  120. data/test/mailers/unlock_instructions_test.rb +0 -93
  121. data/test/mapping_test.rb +0 -136
  122. data/test/models/authenticatable_test.rb +0 -25
  123. data/test/models/confirmable_test.rb +0 -549
  124. data/test/models/database_authenticatable_test.rb +0 -283
  125. data/test/models/lockable_test.rb +0 -352
  126. data/test/models/omniauthable_test.rb +0 -9
  127. data/test/models/recoverable_test.rb +0 -263
  128. data/test/models/registerable_test.rb +0 -9
  129. data/test/models/rememberable_test.rb +0 -184
  130. data/test/models/serializable_test.rb +0 -60
  131. data/test/models/timeoutable_test.rb +0 -53
  132. data/test/models/trackable_test.rb +0 -62
  133. data/test/models/validatable_test.rb +0 -121
  134. data/test/models_test.rb +0 -155
  135. data/test/omniauth/config_test.rb +0 -61
  136. data/test/omniauth/url_helpers_test.rb +0 -53
  137. data/test/orm/active_record.rb +0 -24
  138. data/test/orm/mongoid.rb +0 -15
  139. data/test/parameter_sanitizer_test.rb +0 -77
  140. data/test/rails_app/Rakefile +0 -6
  141. data/test/rails_app/app/active_record/admin.rb +0 -8
  142. data/test/rails_app/app/active_record/shim.rb +0 -4
  143. data/test/rails_app/app/active_record/user.rb +0 -20
  144. data/test/rails_app/app/active_record/user_on_engine.rb +0 -9
  145. data/test/rails_app/app/active_record/user_on_main_app.rb +0 -9
  146. data/test/rails_app/app/active_record/user_with_validations.rb +0 -12
  147. data/test/rails_app/app/active_record/user_without_email.rb +0 -10
  148. data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -8
  149. data/test/rails_app/app/controllers/admins_controller.rb +0 -8
  150. data/test/rails_app/app/controllers/application_controller.rb +0 -13
  151. data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -32
  152. data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -33
  153. data/test/rails_app/app/controllers/home_controller.rb +0 -31
  154. data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -4
  155. data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -4
  156. data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -16
  157. data/test/rails_app/app/controllers/users_controller.rb +0 -33
  158. data/test/rails_app/app/helpers/application_helper.rb +0 -5
  159. data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -5
  160. data/test/rails_app/app/mailers/users/mailer.rb +0 -5
  161. data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -6
  162. data/test/rails_app/app/mongoid/admin.rb +0 -31
  163. data/test/rails_app/app/mongoid/shim.rb +0 -25
  164. data/test/rails_app/app/mongoid/user.rb +0 -50
  165. data/test/rails_app/app/mongoid/user_on_engine.rb +0 -41
  166. data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -41
  167. data/test/rails_app/app/mongoid/user_with_validations.rb +0 -37
  168. data/test/rails_app/app/mongoid/user_without_email.rb +0 -35
  169. data/test/rails_app/app/views/admins/index.html.erb +0 -1
  170. data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
  171. data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
  172. data/test/rails_app/app/views/home/index.html.erb +0 -1
  173. data/test/rails_app/app/views/home/join.html.erb +0 -1
  174. data/test/rails_app/app/views/home/private.html.erb +0 -1
  175. data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
  176. data/test/rails_app/app/views/layouts/application.html.erb +0 -24
  177. data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
  178. data/test/rails_app/app/views/users/index.html.erb +0 -1
  179. data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
  180. data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
  181. data/test/rails_app/bin/bundle +0 -3
  182. data/test/rails_app/bin/rails +0 -4
  183. data/test/rails_app/bin/rake +0 -4
  184. data/test/rails_app/config.ru +0 -4
  185. data/test/rails_app/config/application.rb +0 -48
  186. data/test/rails_app/config/boot.rb +0 -27
  187. data/test/rails_app/config/database.yml +0 -18
  188. data/test/rails_app/config/environment.rb +0 -7
  189. data/test/rails_app/config/environments/development.rb +0 -32
  190. data/test/rails_app/config/environments/production.rb +0 -88
  191. data/test/rails_app/config/environments/test.rb +0 -47
  192. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -9
  193. data/test/rails_app/config/initializers/devise.rb +0 -182
  194. data/test/rails_app/config/initializers/inflections.rb +0 -4
  195. data/test/rails_app/config/initializers/secret_token.rb +0 -5
  196. data/test/rails_app/config/initializers/session_store.rb +0 -3
  197. data/test/rails_app/config/routes.rb +0 -128
  198. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -77
  199. data/test/rails_app/db/schema.rb +0 -57
  200. data/test/rails_app/lib/shared_admin.rb +0 -23
  201. data/test/rails_app/lib/shared_user.rb +0 -32
  202. data/test/rails_app/lib/shared_user_without_email.rb +0 -28
  203. data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -15
  204. data/test/rails_app/public/404.html +0 -26
  205. data/test/rails_app/public/422.html +0 -26
  206. data/test/rails_app/public/500.html +0 -26
  207. data/test/rails_app/public/favicon.ico +0 -0
  208. data/test/rails_test.rb +0 -11
  209. data/test/routes_test.rb +0 -281
  210. data/test/secret_key_finder_test.rb +0 -97
  211. data/test/support/action_controller/record_identifier.rb +0 -12
  212. data/test/support/assertions.rb +0 -30
  213. data/test/support/helpers.rb +0 -83
  214. data/test/support/http_method_compatibility.rb +0 -53
  215. data/test/support/integration.rb +0 -95
  216. data/test/support/locale/en.yml +0 -8
  217. data/test/support/mongoid.yml +0 -6
  218. data/test/support/webrat/integrations/rails.rb +0 -35
  219. data/test/test/controller_helpers_test.rb +0 -193
  220. data/test/test/integration_helpers_test.rb +0 -34
  221. data/test/test_helper.rb +0 -36
  222. data/test/test_models.rb +0 -35
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- unless defined?(DEVISE_ORM)
4
- DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
5
- end
6
-
7
- module Devise
8
- module Test
9
- # Detection for minor differences between Rails 4 and 5, 5.1, and 5.2 in tests.
10
-
11
- def self.rails52?
12
- Rails.version.start_with? '5.2'
13
- end
14
-
15
- def self.rails51?
16
- Rails.version.start_with? '5.1'
17
- end
18
-
19
- def self.rails5?
20
- Rails.version.start_with? '5'
21
- end
22
- end
23
- end
24
-
25
- # Set up gems listed in the Gemfile.
26
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
27
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -1,18 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
- development:
4
- adapter: sqlite3
5
- database: db/development.sqlite3
6
- pool: 5
7
- timeout: 5000
8
-
9
- # Warning: The database defined as "test" will be erased and
10
- # re-generated from your development database when you run "rake".
11
- # Do not set this db to the same as development or production.
12
- test:
13
- adapter: sqlite3
14
- database: ":memory:"
15
-
16
- production:
17
- adapter: sqlite3
18
- database: ":memory:"
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Load the rails application.
4
- require File.expand_path('../application', __FILE__)
5
-
6
- # Initialize the rails application.
7
- RailsApp::Application.initialize!
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RailsApp::Application.configure do
4
- # Settings specified here will take precedence over those in config/application.rb.
5
-
6
- # In the development environment your application's code is reloaded on
7
- # every request. This slows down response time but is perfect for development
8
- # since you don't have to restart the web server when you make code changes.
9
- config.cache_classes = false
10
-
11
- # Do not eager load code on boot.
12
- config.eager_load = false
13
-
14
- # Show full error reports and disable caching.
15
- config.consider_all_requests_local = true
16
- config.action_controller.perform_caching = false
17
-
18
- # Don't care if the mailer can't send.
19
- config.action_mailer.raise_delivery_errors = false
20
-
21
- # Print deprecation notices to the Rails logger.
22
- config.active_support.deprecation = :log
23
-
24
- # Only use best-standards-support built into browsers.
25
- config.action_dispatch.best_standards_support = :builtin
26
-
27
- # Raise an error on page load if there are pending migrations
28
- config.active_record.migration_error = :page_load
29
-
30
- # Debug mode disables concatenation and preprocessing of assets.
31
- config.assets.debug = true
32
- end
@@ -1,88 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RailsApp::Application.configure do
4
- # Settings specified here will take precedence over those in config/application.rb.
5
-
6
- # Code is not reloaded between requests.
7
- config.cache_classes = true
8
-
9
- # Eager load code on boot. This eager loads most of Rails and
10
- # your application in memory, allowing both thread web servers
11
- # and those relying on copy on write to perform better.
12
- # Rake tasks automatically ignore this option for performance.
13
- config.eager_load = true
14
-
15
- # Full error reports are disabled and caching is turned on.
16
- config.consider_all_requests_local = false
17
- config.action_controller.perform_caching = true
18
-
19
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
20
- # Add `rack-cache` to your Gemfile before enabling this.
21
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
22
- # config.action_dispatch.rack_cache = true
23
-
24
- # Disable Rails's static asset server (Apache or nginx will already do this).
25
- if Rails.version >= "5.0.0"
26
- config.public_file_server.enabled = false
27
- elsif Rails.version >= "4.2.0"
28
- config.serve_static_files = false
29
- else
30
- config.serve_static_assets = false
31
- end
32
-
33
- # Compress JavaScripts and CSS.
34
- config.assets.js_compressor = :uglifier
35
- # config.assets.css_compressor = :sass
36
-
37
- # Whether to fallback to assets pipeline if a precompiled asset is missed.
38
- config.assets.compile = false
39
-
40
- # Generate digests for assets URLs.
41
- config.assets.digest = true
42
-
43
- # Version of your assets, change this if you want to expire all your assets.
44
- config.assets.version = '1.0'
45
-
46
- # Specifies the header that your server uses for sending files.
47
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
48
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
49
-
50
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51
- # config.force_ssl = true
52
-
53
- # Set to :debug to see everything in the log.
54
- config.log_level = :info
55
-
56
- # Prepend all log lines with the following tags.
57
- # config.log_tags = [:subdomain, :uuid]
58
-
59
- # Use a different logger for distributed setups.
60
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
61
-
62
- # Use a different cache store in production.
63
- # config.cache_store = :mem_cache_store
64
-
65
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
66
- # config.action_controller.asset_host = "http://assets.example.com"
67
-
68
- # Precompile additional assets.
69
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
70
- # config.assets.precompile += %w( search.js )
71
-
72
- # Ignore bad email addresses and do not raise email delivery errors.
73
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
74
- # config.action_mailer.raise_delivery_errors = false
75
-
76
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
77
- # the I18n.default_locale when a translation can not be found).
78
- config.i18n.fallbacks = true
79
-
80
- # Send deprecation notices to registered listeners.
81
- config.active_support.deprecation = :notify
82
-
83
- # Disable automatic flushing of the log to improve performance.
84
- # config.autoflush_log = false
85
-
86
- # Use default logging formatter so that PID and timestamp are not suppressed.
87
- config.log_formatter = ::Logger::Formatter.new
88
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RailsApp::Application.configure do
4
- # Settings specified here will take precedence over those in config/application.rb.
5
-
6
- # The test environment is used exclusively to run your application's
7
- # test suite. You never need to work with it otherwise. Remember that
8
- # your test database is "scratch space" for the test suite and is wiped
9
- # and recreated between test runs. Don't rely on the data there!
10
- config.cache_classes = true
11
-
12
- # Do not eager load code on boot. This avoids loading your whole application
13
- # just for the purpose of running a single test. If you are using a tool that
14
- # preloads Rails for running tests, you may have to set it to true.
15
- config.eager_load = false
16
-
17
- # Disable serving static files from the `/public` folder by default since
18
- # Apache or NGINX already handles this.
19
- if Rails.version >= "5.0.0"
20
- config.public_file_server.enabled = true
21
- config.public_file_server.headers = {'Cache-Control' => 'public, max-age=3600'}
22
- elsif Rails.version >= "4.2.0"
23
- config.serve_static_files = true
24
- config.static_cache_control = "public, max-age=3600"
25
- else
26
- config.serve_static_assets = true
27
- config.static_cache_control = "public, max-age=3600"
28
- end
29
-
30
- # Show full error reports and disable caching.
31
- config.consider_all_requests_local = true
32
- config.action_controller.perform_caching = false
33
-
34
- # Raise exceptions instead of rendering exception templates.
35
- config.action_dispatch.show_exceptions = false
36
-
37
- # Disable request forgery protection in test environment.
38
- config.action_controller.allow_forgery_protection = false
39
-
40
- # Tell Action Mailer not to deliver emails to the real world.
41
- # The :test delivery method accumulates sent emails in the
42
- # ActionMailer::Base.deliveries array.
43
- config.action_mailer.delivery_method = :test
44
-
45
- # Print deprecation notices to the stderr.
46
- config.active_support.deprecation = :stderr
47
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Be sure to restart your server when you modify this file.
4
-
5
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
6
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
7
-
8
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
9
- Rails.backtrace_cleaner.remove_silencers!
@@ -1,182 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "omniauth-facebook"
4
- require "omniauth-openid"
5
-
6
- # Use this hook to configure devise mailer, warden hooks and so forth. The first
7
- # four configuration values can also be set straight in your models.
8
- Devise.setup do |config|
9
- config.secret_key = "d9eb5171c59a4c817f68b0de27b8c1e340c2341b52cdbc60d3083d4e8958532" \
10
- "18dcc5f589cafde048faec956b61f864b9b5513ff9ce29bf9e5d58b0f234f8e3b"
11
-
12
- # ==> Mailer Configuration
13
- # Configure the e-mail address which will be shown in Devise::Mailer,
14
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
15
- config.mailer_sender = "please-change-me@config-initializers-devise.com"
16
-
17
-
18
- config.parent_controller = "ApplicationWithFakeEngine"
19
- # Configure the class responsible to send e-mails.
20
- # config.mailer = "Devise::Mailer"
21
-
22
- # ==> ORM configuration
23
- # Load and configure the ORM. Supports :active_record (default) and
24
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
25
- # available as additional gems.
26
- require "devise/orm/#{DEVISE_ORM}"
27
-
28
- # ==> Configuration for any authentication mechanism
29
- # Configure which keys are used when authenticating a user. By default is
30
- # just :email. You can configure it to use [:username, :subdomain], so for
31
- # authenticating a user, both parameters are required. Remember that those
32
- # parameters are used only when authenticating and not when retrieving from
33
- # session. If you need permissions, you should implement that in a before filter.
34
- # You can also supply hash where the value is a boolean expliciting if authentication
35
- # should be aborted or not if the value is not present. By default is empty.
36
- # config.authentication_keys = [:email]
37
-
38
- # Configure parameters from the request object used for authentication. Each entry
39
- # given should be a request method and it will automatically be passed to
40
- # find_for_authentication method and considered in your model lookup. For instance,
41
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
42
- # The same considerations mentioned for authentication_keys also apply to request_keys.
43
- # config.request_keys = []
44
-
45
- # Configure which authentication keys should be case-insensitive.
46
- # These keys will be downcased upon creating or modifying a user and when used
47
- # to authenticate or find a user. Default is :email.
48
- config.case_insensitive_keys = [:email]
49
-
50
- # Configure which authentication keys should have whitespace stripped.
51
- # These keys will have whitespace before and after removed upon creating or
52
- # modifying a user and when used to authenticate or find a user. Default is :email.
53
- config.strip_whitespace_keys = [:email]
54
-
55
- # Tell if authentication through request.params is enabled. True by default.
56
- # config.params_authenticatable = true
57
-
58
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
59
- config.http_authenticatable = true
60
-
61
- # If http headers should be returned for AJAX requests. True by default.
62
- # config.http_authenticatable_on_xhr = true
63
-
64
- # The realm used in Http Basic Authentication. "Application" by default.
65
- # config.http_authentication_realm = "Application"
66
-
67
- # ==> Configuration for :database_authenticatable
68
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
69
- # using other encryptors, it sets how many times you want the password re-encrypted.
70
- config.stretches = Rails.env.test? ? 1 : 10
71
-
72
- # ==> Configuration for :confirmable
73
- # The time you want to give your user to confirm their account. During this time
74
- # they will be able to access your application without confirming. Default is nil.
75
- # When allow_unconfirmed_access_for is zero, the user won't be able to sign in without confirming.
76
- # You can use this to let your user access some features of your application
77
- # without confirming the account, but blocking it after a certain period
78
- # (ie 2 days).
79
- # config.allow_unconfirmed_access_for = 2.days
80
-
81
- # Defines which key will be used when confirming an account
82
- # config.confirmation_keys = [:email]
83
-
84
- # ==> Configuration for :rememberable
85
- # The time the user will be remembered without asking for credentials again.
86
- # config.remember_for = 2.weeks
87
-
88
- # If true, extends the user's remember period when remembered via cookie.
89
- # config.extend_remember_period = false
90
-
91
- # ==> Configuration for :validatable
92
- # Range for password length. Default is 8..72.
93
- # config.password_length = 8..72
94
-
95
- # Regex to use to validate the email address
96
- # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
97
-
98
- # ==> Configuration for :timeoutable
99
- # The time you want to timeout the user session without activity. After this
100
- # time the user will be asked for credentials again. Default is 30 minutes.
101
- # config.timeout_in = 30.minutes
102
-
103
- # ==> Configuration for :lockable
104
- # Defines which strategy will be used to lock an account.
105
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
106
- # :none = No lock strategy. You should handle locking by yourself.
107
- # config.lock_strategy = :failed_attempts
108
-
109
- # Defines which key will be used when locking and unlocking an account
110
- # config.unlock_keys = [:email]
111
-
112
- # Defines which strategy will be used to unlock an account.
113
- # :email = Sends an unlock link to the user email
114
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
115
- # :both = Enables both strategies
116
- # :none = No unlock strategy. You should handle unlocking by yourself.
117
- # config.unlock_strategy = :both
118
-
119
- # Number of authentication tries before locking an account if lock_strategy
120
- # is failed attempts.
121
- # config.maximum_attempts = 20
122
-
123
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
124
- # config.unlock_in = 1.hour
125
-
126
- # ==> Configuration for :recoverable
127
- #
128
- # Defines which key will be used when recovering the password for an account
129
- # config.reset_password_keys = [:email]
130
-
131
- # Time interval you can reset your password with a reset password key.
132
- # Don't put a too small interval or your users won't have the time to
133
- # change their passwords.
134
- config.reset_password_within = 2.hours
135
-
136
- # When set to false, does not sign a user in automatically after their password is
137
- # reset. Defaults to true, so a user is signed in automatically after a reset.
138
- # config.sign_in_after_reset_password = true
139
-
140
- # Set up a pepper to generate the encrypted password.
141
- config.pepper = "d142367154e5beacca404b1a6a4f8bc52c6fdcfa3ccc3cf8eb49f3458a688ee6ac3b9fae488432a3bfca863b8a90008368a9f3a3dfbe5a962e64b6ab8f3a3a1a"
142
-
143
- # ==> Scopes configuration
144
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
145
- # "users/sessions/new". It's turned off by default because it's slower if you
146
- # are using only default views.
147
- # config.scoped_views = false
148
-
149
- # Configure the default scope given to Warden. By default it's the first
150
- # devise role declared in your routes (usually :user).
151
- # config.default_scope = :user
152
-
153
- # Configure sign_out behavior.
154
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
155
- # The default is true, which means any logout action will sign out all active scopes.
156
- # config.sign_out_all_scopes = true
157
-
158
- # ==> Navigation configuration
159
- # Lists the formats that should be treated as navigational. Formats like
160
- # :html, should redirect to the sign in page when the user does not have
161
- # access, but formats like :xml or :json, should return 401.
162
- # If you have any extra navigational formats, like :iphone or :mobile, you
163
- # should add them to the navigational formats lists. Default is [:html]
164
- # config.navigational_formats = [:html, :iphone]
165
-
166
- # The default HTTP method used to sign out a resource. Default is :get.
167
- # config.sign_out_via = :get
168
-
169
- # ==> OmniAuth
170
- config.omniauth :facebook, 'APP_ID', 'APP_SECRET', scope: 'email,offline_access'
171
- config.omniauth :openid
172
- config.omniauth :openid, name: 'google', identifier: 'https://www.google.com/accounts/o8/id'
173
-
174
- # ==> Warden configuration
175
- # If you want to use other strategies, that are not supported by Devise, or
176
- # change the failure app, you can configure them inside the config.warden block.
177
- #
178
- # config.warden do |manager|
179
- # manager.failure_app = AnotherApp
180
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
181
- # end
182
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ActiveSupport::Inflector.inflections do |inflect|
4
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- config = Rails.application.config
4
-
5
- config.secret_key_base = 'd588e99efff13a86461fd6ab82327823ad2f8feb5dc217ce652cdd9f0dfc5eb4b5a62a92d24d2574d7d51dfb1ea8dd453ea54e00cf672159a13104a135422a10'
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RailsApp::Application.config.session_store :cookie_store, key: '_rails_app_session'
@@ -1,128 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Rails.application.routes.draw do
4
- # Resources for testing
5
- resources :users, only: [:index] do
6
- member do
7
- get :expire
8
- get :accept
9
- get :edit_form
10
- put :update_form
11
- end
12
-
13
- authenticate do
14
- post :exhibit, on: :member
15
- end
16
- end
17
-
18
- resources :admins, only: [:index]
19
-
20
- # Users scope
21
- devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
22
-
23
- devise_for :user_on_main_apps,
24
- class_name: 'UserOnMainApp',
25
- router_name: :main_app,
26
- module: :devise
27
-
28
- devise_for :user_on_engines,
29
- class_name: 'UserOnEngine',
30
- router_name: :fake_engine,
31
- module: :devise
32
-
33
- devise_for :user_without_email,
34
- class_name: 'UserWithoutEmail',
35
- router_name: :main_app,
36
- module: :devise
37
-
38
- as :user do
39
- get "/as/sign_in", to: "devise/sessions#new"
40
- end
41
-
42
- get "/sign_in", to: "devise/sessions#new"
43
-
44
- # Routes for custom controller testing
45
- devise_for :user, only: [:registrations], controllers: { registrations: "custom/registrations" }, as: :custom, path: :custom
46
-
47
- # Admin scope
48
- devise_for :admin, path: "admin_area", controllers: { sessions: :"admins/sessions" }, skip: :passwords
49
-
50
- get "/admin_area/home", to: "admins#index", as: :admin_root
51
- get "/anywhere", to: "foo#bar", as: :new_admin_password
52
-
53
- authenticate(:admin) do
54
- get "/private", to: "home#private", as: :private
55
- end
56
-
57
- authenticate(:admin, lambda { |admin| admin.active? }) do
58
- get "/private/active", to: "home#private", as: :private_active
59
- end
60
-
61
- authenticated :admin do
62
- get "/dashboard", to: "home#admin_dashboard"
63
- end
64
-
65
- authenticated :admin, lambda { |admin| admin.active? } do
66
- get "/dashboard/active", to: "home#admin_dashboard"
67
- end
68
-
69
- authenticated do
70
- get "/dashboard", to: "home#user_dashboard"
71
- end
72
-
73
- unauthenticated do
74
- get "/join", to: "home#join"
75
- end
76
-
77
- # Routes for constraints testing
78
- devise_for :headquarters_admin, class_name: "Admin", path: "headquarters", constraints: {host: /192\.168\.1\.\d\d\d/}
79
-
80
- constraints(host: /192\.168\.1\.\d\d\d/) do
81
- devise_for :homebase_admin, class_name: "Admin", path: "homebase"
82
- end
83
-
84
- scope(subdomain: 'sub') do
85
- devise_for :subdomain_users, class_name: "User", only: [:sessions]
86
- end
87
-
88
- devise_for :skip_admin, class_name: "Admin", skip: :all
89
-
90
- # Routes for format=false testing
91
- devise_for :htmlonly_admin, class_name: "Admin", skip: [:confirmations, :unlocks], path: "htmlonly_admin", format: false, skip_helpers: [:confirmations, :unlocks]
92
- devise_for :htmlonly_users, class_name: "User", only: [:confirmations, :unlocks], path: "htmlonly_users", format: false, skip_helpers: true
93
-
94
- # Other routes for routing_test.rb
95
- devise_for :reader, class_name: "User", only: :passwords
96
-
97
- scope host: "sub.example.com" do
98
- devise_for :sub_admin, class_name: "Admin"
99
- end
100
-
101
- namespace :publisher, path_names: { sign_in: "i_dont_care", sign_out: "get_out" } do
102
- devise_for :accounts, class_name: "Admin", path_names: { sign_in: "get_in" }
103
- end
104
-
105
- scope ":locale", module: :invalid do
106
- devise_for :accounts, singular: "manager", class_name: "Admin",
107
- path_names: {
108
- sign_in: "login", sign_out: "logout",
109
- password: "secret", confirmation: "verification",
110
- unlock: "unblock", sign_up: "register",
111
- registration: "management",
112
- cancel: "giveup", edit: "edit/profile"
113
- }, failure_app: lambda { |env| [404, {"Content-Type" => "text/plain"}, ["Oops, not found"]] }, module: :devise
114
- end
115
-
116
- namespace :sign_out_via, module: "devise" do
117
- devise_for :deletes, sign_out_via: :delete, class_name: "Admin"
118
- devise_for :posts, sign_out_via: :post, class_name: "Admin"
119
- devise_for :gets, sign_out_via: :get, class_name: "Admin"
120
- devise_for :delete_or_posts, sign_out_via: [:delete, :post], class_name: "Admin"
121
- end
122
-
123
- get "/set", to: "home#set"
124
- get "/unauthenticated", to: "home#unauthenticated"
125
- get "/custom_strategy/new"
126
-
127
- root to: "home#index", via: [:get, :post]
128
- end