admin_invitable 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +18 -17
  3. data/lib/admin_invitable/engine.rb +1 -2
  4. data/lib/admin_invitable/version.rb +1 -1
  5. data/spec/dummy/Rakefile +1 -1
  6. data/spec/dummy/app/admin/admin_users.rb +1 -3
  7. data/spec/dummy/app/admin/dashboard.rb +2 -3
  8. data/spec/dummy/app/assets/config/manifest.js +2 -0
  9. data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
  10. data/spec/dummy/app/assets/stylesheets/{active_admin.css.scss → active_admin.scss} +3 -3
  11. data/spec/dummy/app/assets/stylesheets/application.css +5 -5
  12. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  13. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  14. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  15. data/spec/dummy/app/javascript/packs/application.js +15 -0
  16. data/spec/dummy/app/jobs/application_job.rb +7 -0
  17. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  18. data/spec/dummy/app/models/admin_user.rb +2 -2
  19. data/spec/dummy/app/models/application_record.rb +3 -0
  20. data/spec/dummy/app/views/layouts/application.html.erb +10 -9
  21. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  22. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  23. data/spec/dummy/bin/rails +3 -3
  24. data/spec/dummy/bin/rake +2 -2
  25. data/spec/dummy/bin/setup +33 -0
  26. data/spec/dummy/config.ru +3 -1
  27. data/spec/dummy/config/application.rb +12 -13
  28. data/spec/dummy/config/boot.rb +3 -3
  29. data/spec/dummy/config/cable.yml +10 -0
  30. data/spec/dummy/config/database.yml +2 -2
  31. data/spec/dummy/config/environment.rb +1 -1
  32. data/spec/dummy/config/environments/development.rb +56 -12
  33. data/spec/dummy/config/environments/production.rb +65 -23
  34. data/spec/dummy/config/environments/test.rb +29 -9
  35. data/spec/dummy/config/initializers/active_admin.rb +106 -4
  36. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  37. data/spec/dummy/config/initializers/assets.rb +6 -2
  38. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  39. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  40. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -1
  41. data/spec/dummy/config/initializers/devise.rb +94 -32
  42. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  43. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  44. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  45. data/spec/dummy/config/locales/devise.en.yml +7 -2
  46. data/spec/dummy/config/locales/devise_invitable.en.yml +9 -1
  47. data/spec/dummy/config/locales/en.yml +11 -1
  48. data/spec/dummy/config/puma.rb +43 -0
  49. data/spec/dummy/config/storage.yml +34 -0
  50. data/spec/dummy/db/migrate/{20150410143721_devise_create_admin_users.rb → 20210618143445_devise_create_admin_users.rb} +9 -13
  51. data/spec/dummy/db/migrate/{20150410143725_create_active_admin_comments.rb → 20210618143451_create_active_admin_comments.rb} +2 -5
  52. data/spec/dummy/db/migrate/{20150410152955_devise_invitable_add_to_admin_users.rb → 20210618143525_devise_invitable_add_to_admin_users.rb} +4 -9
  53. data/spec/dummy/db/schema.rb +34 -42
  54. data/spec/dummy/public/404.html +6 -6
  55. data/spec/dummy/public/422.html +6 -6
  56. data/spec/dummy/public/500.html +6 -6
  57. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  58. data/spec/dummy/public/apple-touch-icon.png +0 -0
  59. data/spec/dummy/spec/factories/admin_users.rb +3 -3
  60. data/spec/dummy/spec/models/admin_user_spec.rb +7 -0
  61. data/spec/rails_helper.rb +6 -4
  62. metadata +116 -61
  63. data/spec/dummy/README.rdoc +0 -28
  64. data/spec/dummy/bin/bundle +0 -3
  65. data/spec/dummy/config/initializers/session_store.rb +0 -3
  66. data/spec/dummy/config/secrets.yml +0 -22
  67. data/spec/dummy/db/test.sqlite3 +0 -0
  68. data/spec/dummy/log/test.log +0 -464
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -14,47 +16,53 @@ Rails.application.configure do
14
16
  config.consider_all_requests_local = false
15
17
  config.action_controller.perform_caching = true
16
18
 
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
19
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
21
22
 
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
24
26
 
25
- # Compress JavaScripts and CSS.
26
- config.assets.js_compressor = :uglifier
27
+ # Compress CSS using a preprocessor.
27
28
  # config.assets.css_compressor = :sass
28
29
 
29
30
  # Do not fallback to assets pipeline if a precompiled asset is missed.
30
31
  config.assets.compile = false
31
32
 
32
- # Generate digests for assets URLs.
33
- config.assets.digest = true
34
-
35
- # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
33
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34
+ # config.asset_host = 'http://assets.example.com'
36
35
 
37
36
  # Specifies the header that your server uses for sending files.
38
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
39
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
37
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
38
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
39
+
40
+ # Store uploaded files on the local file system (see config/storage.yml for options).
41
+ config.active_storage.service = :local
42
+
43
+ # Mount Action Cable outside main process or domain.
44
+ # config.action_cable.mount_path = nil
45
+ # config.action_cable.url = 'wss://example.com/cable'
46
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
40
47
 
41
48
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42
49
  # config.force_ssl = true
43
50
 
44
- # Set to :debug to see everything in the log.
51
+ # Include generic and useful information about system operation, but avoid logging too much
52
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
45
53
  config.log_level = :info
46
54
 
47
55
  # Prepend all log lines with the following tags.
48
- # config.log_tags = [ :subdomain, :uuid ]
49
-
50
- # Use a different logger for distributed setups.
51
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+ config.log_tags = [ :request_id ]
52
57
 
53
58
  # Use a different cache store in production.
54
59
  # config.cache_store = :mem_cache_store
55
60
 
56
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
57
- # config.action_controller.asset_host = "http://assets.example.com"
61
+ # Use a real queuing backend for Active Job (and separate queues per environment).
62
+ # config.active_job.queue_adapter = :resque
63
+ # config.active_job.queue_name_prefix = "dummy_production"
64
+
65
+ config.action_mailer.perform_caching = false
58
66
 
59
67
  # Ignore bad email addresses and do not raise email delivery errors.
60
68
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -67,12 +75,46 @@ Rails.application.configure do
67
75
  # Send deprecation notices to registered listeners.
68
76
  config.active_support.deprecation = :notify
69
77
 
70
- # Disable automatic flushing of the log to improve performance.
71
- # config.autoflush_log = false
78
+ # Log disallowed deprecations.
79
+ config.active_support.disallowed_deprecation = :log
80
+
81
+ # Tell Active Support which deprecation messages to disallow.
82
+ config.active_support.disallowed_deprecation_warnings = []
72
83
 
73
84
  # Use default logging formatter so that PID and timestamp are not suppressed.
74
85
  config.log_formatter = ::Logger::Formatter.new
75
86
 
87
+ # Use a different logger for distributed setups.
88
+ # require "syslog/logger"
89
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
90
+
91
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
92
+ logger = ActiveSupport::Logger.new(STDOUT)
93
+ logger.formatter = config.log_formatter
94
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
95
+ end
96
+
76
97
  # Do not dump schema after migrations.
77
98
  config.active_record.dump_schema_after_migration = false
99
+
100
+ # Inserts middleware to perform automatic connection switching.
101
+ # The `database_selector` hash is used to pass options to the DatabaseSelector
102
+ # middleware. The `delay` is used to determine how long to wait after a write
103
+ # to send a subsequent read to the primary.
104
+ #
105
+ # The `database_resolver` class is used by the middleware to determine which
106
+ # database is appropriate to use based on the time delay.
107
+ #
108
+ # The `database_resolver_context` class is used by the middleware to set
109
+ # timestamps for the last write to the primary. The resolver uses the context
110
+ # class timestamps to determine how long to wait before reading from the
111
+ # replica.
112
+ #
113
+ # By default Rails will store a last write timestamp in the session. The
114
+ # DatabaseSelector middleware is designed as such you can define your own
115
+ # strategy for connection switching and pass that into the middleware through
116
+ # these configuration options.
117
+ # config.active_record.database_selector = { delay: 2.seconds }
118
+ # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
119
+ # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
78
120
  end
@@ -1,10 +1,13 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+
1
8
  Rails.application.configure do
2
9
  # Settings specified here will take precedence over those in config/application.rb.
3
10
 
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
11
  config.cache_classes = true
9
12
 
10
13
  # Do not eager load code on boot. This avoids loading your whole application
@@ -12,13 +15,16 @@ Rails.application.configure do
12
15
  # preloads Rails for running tests, you may have to set it to true.
13
16
  config.eager_load = false
14
17
 
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
17
- config.static_cache_control = 'public, max-age=3600'
18
+ # Configure public file server for tests with Cache-Control for performance.
19
+ config.public_file_server.enabled = true
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
22
+ }
18
23
 
19
24
  # Show full error reports and disable caching.
20
25
  config.consider_all_requests_local = true
21
26
  config.action_controller.perform_caching = false
27
+ config.cache_store = :null_store
22
28
 
23
29
  # Raise exceptions instead of rendering exception templates.
24
30
  config.action_dispatch.show_exceptions = false
@@ -26,6 +32,11 @@ Rails.application.configure do
26
32
  # Disable request forgery protection in test environment.
27
33
  config.action_controller.allow_forgery_protection = false
28
34
 
35
+ # Store uploaded files on the local file system in a temporary directory.
36
+ config.active_storage.service = :test
37
+
38
+ config.action_mailer.perform_caching = false
39
+
29
40
  # Tell Action Mailer not to deliver emails to the real world.
30
41
  # The :test delivery method accumulates sent emails in the
31
42
  # ActionMailer::Base.deliveries array.
@@ -34,6 +45,15 @@ Rails.application.configure do
34
45
  # Print deprecation notices to the stderr.
35
46
  config.active_support.deprecation = :stderr
36
47
 
37
- # Raises error for missing translations
38
- # config.action_view.raise_on_missing_translations = true
48
+ # Raise exceptions for disallowed deprecations.
49
+ config.active_support.disallowed_deprecation = :raise
50
+
51
+ # Tell Active Support which deprecation messages to disallow.
52
+ config.active_support.disallowed_deprecation_warnings = []
53
+
54
+ # Raises error for missing translations.
55
+ # config.i18n.raise_on_missing_translations = true
56
+
57
+ # Annotate rendered view with file names.
58
+ # config.action_view.annotate_rendered_view_with_filenames = true
39
59
  end
@@ -69,6 +69,11 @@ ActiveAdmin.setup do |config|
69
69
  # case when Pundit is unable to find suitable policy.
70
70
  # config.pundit_default_policy = "MyDefaultPunditPolicy"
71
71
 
72
+ # If you wish to maintain a separate set of Pundit policies for admin
73
+ # resources, you may set a namespace here that Pundit will search
74
+ # within when looking for a resource's policy.
75
+ # config.pundit_policy_namespace = :admin
76
+
72
77
  # You can customize your CanCan Ability class name here.
73
78
  # config.cancan_ability_class = "Ability"
74
79
 
@@ -121,11 +126,18 @@ ActiveAdmin.setup do |config|
121
126
  # You can completely disable comments:
122
127
  # config.comments = false
123
128
  #
124
- # You can disable the menu item for the comments index page:
125
- # config.show_comments_in_menu = false
126
- #
127
129
  # You can change the name under which comments are registered:
128
130
  # config.comments_registration_name = 'AdminComment'
131
+ #
132
+ # You can change the order for the comments and you can change the column
133
+ # to be used for ordering:
134
+ # config.comments_order = 'created_at ASC'
135
+ #
136
+ # You can disable the menu item for the comments index page:
137
+ # config.comments_menu = false
138
+ #
139
+ # You can customize the comment menu:
140
+ # config.comments_menu = { parent: 'Admin', priority: 1 }
129
141
 
130
142
  # == Batch Actions
131
143
  #
@@ -138,12 +150,43 @@ ActiveAdmin.setup do |config|
138
150
  # You can add before, after and around filters to all of your
139
151
  # Active Admin resources and pages from here.
140
152
  #
141
- # config.before_filter :do_something_awesome
153
+ # config.before_action :do_something_awesome
154
+
155
+ # == Attribute Filters
156
+ #
157
+ # You can exclude possibly sensitive model attributes from being displayed,
158
+ # added to forms, or exported by default by ActiveAdmin
159
+ #
160
+ config.filter_attributes = [:encrypted_password, :password, :password_confirmation]
161
+
162
+ # == Localize Date/Time Format
163
+ #
164
+ # Set the localize format to display dates and times.
165
+ # To understand how to localize your app with I18n, read more at
166
+ # https://guides.rubyonrails.org/i18n.html
167
+ #
168
+ # You can run `bin/rails runner 'puts I18n.t("date.formats")'` to see the
169
+ # available formats in your application.
170
+ #
171
+ config.localize_format = :long
142
172
 
143
173
  # == Setting a Favicon
144
174
  #
145
175
  # config.favicon = 'favicon.ico'
146
176
 
177
+ # == Meta Tags
178
+ #
179
+ # Add additional meta tags to the head element of active admin pages.
180
+ #
181
+ # Add tags to all pages logged in users see:
182
+ # config.meta_tags = { author: 'My Company' }
183
+
184
+ # By default, sign up/sign in/recover password pages are excluded
185
+ # from showing up in search engine results by adding a robots meta
186
+ # tag. You can reset the hash of meta tags included in logged out
187
+ # pages:
188
+ # config.meta_tags_for_logged_out_pages = {}
189
+
147
190
  # == Removing Breadcrumbs
148
191
  #
149
192
  # Breadcrumbs are enabled by default. You can customize them for individual
@@ -151,6 +194,13 @@ ActiveAdmin.setup do |config|
151
194
  #
152
195
  # config.breadcrumb = false
153
196
 
197
+ # == Create Another Checkbox
198
+ #
199
+ # Create another checkbox is disabled by default. You can customize it for individual
200
+ # resources or you can enable them globally from here.
201
+ #
202
+ # config.create_another = true
203
+
154
204
  # == Register Stylesheets & Javascripts
155
205
  #
156
206
  # We recommend using the built in Active Admin layout and loading
@@ -222,6 +272,10 @@ ActiveAdmin.setup do |config|
222
272
  # You can control the default per page count for all resources here.
223
273
  #
224
274
  # config.default_per_page = 30
275
+ #
276
+ # You can control the max per page count too.
277
+ #
278
+ # config.max_per_page = 10_000
225
279
 
226
280
  # == Filters
227
281
  #
@@ -230,4 +284,52 @@ ActiveAdmin.setup do |config|
230
284
  # You can enable or disable them for all resources here.
231
285
  #
232
286
  # config.filters = true
287
+ #
288
+ # By default the filters include associations in a select, which means
289
+ # that every record will be loaded for each association (up
290
+ # to the value of config.maximum_association_filter_arity).
291
+ # You can enabled or disable the inclusion
292
+ # of those filters by default here.
293
+ #
294
+ # config.include_default_association_filters = true
295
+
296
+ # config.maximum_association_filter_arity = 256 # default value of :unlimited will change to 256 in a future version
297
+ # config.filter_columns_for_large_association = [
298
+ # :display_name,
299
+ # :full_name,
300
+ # :name,
301
+ # :username,
302
+ # :login,
303
+ # :title,
304
+ # :email,
305
+ # ]
306
+ # config.filter_method_for_large_association = '_starts_with'
307
+
308
+ # == Head
309
+ #
310
+ # You can add your own content to the site head like analytics. Make sure
311
+ # you only pass content you trust.
312
+ #
313
+ # config.head = ''.html_safe
314
+
315
+ # == Footer
316
+ #
317
+ # By default, the footer shows the current Active Admin version. You can
318
+ # override the content of the footer here.
319
+ #
320
+ # config.footer = 'my custom footer text'
321
+
322
+ # == Sorting
323
+ #
324
+ # By default ActiveAdmin::OrderClause is used for sorting logic
325
+ # You can inherit it with own class and inject it for all resources
326
+ #
327
+ # config.order_clause = MyOrderClause
328
+
329
+ # == Webpacker
330
+ #
331
+ # By default, Active Admin uses Sprocket's asset pipeline.
332
+ # You can switch to using Webpacker here.
333
+ #
334
+ # config.use_webpacker = true
233
335
  end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -3,6 +3,10 @@
3
3
  # Version of your assets, change this if you want to expire all your assets.
4
4
  Rails.application.config.assets.version = '1.0'
5
5
 
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
6
9
  # Precompile additional assets.
7
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
- # Rails.application.config.assets.precompile += %w( search.js )
10
+ # application.js, application.css, and all non-JS/CSS in the app/assets
11
+ # folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -1,7 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
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/ }
4
+ # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
5
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!
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
7
+ # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
8
+ Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
@@ -0,0 +1,28 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Set the nonce only to specific directives
23
+ # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
24
+
25
+ # Report CSP violations to a specified URI
26
+ # For further information see the following documentation:
27
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
28
+ # Rails.application.config.content_security_policy_report_only = true
@@ -1,3 +1,5 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.action_dispatch.cookies_serializer = :json
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,10 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Assuming you have not yet modified this file, each configuration option below
4
+ # is set to its default value. Note that some are commented out while others
5
+ # are not: uncommented lines are intended to protect your configuration from
6
+ # breaking changes in upgrades (i.e., in the event that future versions of
7
+ # Devise change the default values for those options).
8
+ #
1
9
  # Use this hook to configure devise mailer, warden hooks and so forth.
2
10
  # Many of these configuration options can be set straight in your model.
3
11
  Devise.setup do |config|
4
12
  # The secret key used by Devise. Devise uses this key to generate
5
13
  # random tokens. Changing this key will render invalid all existing
6
14
  # confirmation, reset password and unlock tokens in the database.
7
- # config.secret_key = '2955fa4bb843d7a6735f5e6c42eb3381a767ad77f5cd37f4903d64eba1873caa66bd5abfee5ac733c255eae9f8a356111389cb7468c61d144b4914f7d7decf47'
15
+ # Devise will use the `secret_key_base` as its `secret_key`
16
+ # by default. You can change it below and use your own secret key.
17
+ # config.secret_key = '5895b2e3c90f41c90d489bb3d91b666cb710dd91e2fa737be7fdaa90233f581b5870b4834d9df003e17dc1acd6113fe090cbe12be6cb6293a0e1a01b7fb19cde'
18
+
19
+ # ==> Controller configuration
20
+ # Configure the parent class to the devise controllers.
21
+ # config.parent_controller = 'DeviseController'
8
22
 
9
23
  # ==> Mailer Configuration
10
24
  # Configure the e-mail address which will be shown in Devise::Mailer,
@@ -15,6 +29,9 @@ Devise.setup do |config|
15
29
  # Configure the class responsible to send e-mails.
16
30
  # config.mailer = 'Devise::Mailer'
17
31
 
32
+ # Configure the parent class responsible to send e-mails.
33
+ # config.parent_mailer = 'ActionMailer::Base'
34
+
18
35
  # ==> ORM configuration
19
36
  # Load and configure the ORM. Supports :active_record (default) and
20
37
  # :mongoid (bson_ext recommended) by default. Other ORMs may be
@@ -29,7 +46,7 @@ Devise.setup do |config|
29
46
  # session. If you need permissions, you should implement that in a before filter.
30
47
  # You can also supply a hash where the value is a boolean determining whether
31
48
  # or not authentication should be aborted when the value is not present.
32
- # config.authentication_keys = [ :email ]
49
+ # config.authentication_keys = [:email]
33
50
 
34
51
  # Configure parameters from the request object used for authentication. Each entry
35
52
  # given should be a request method and it will automatically be passed to the
@@ -41,12 +58,12 @@ Devise.setup do |config|
41
58
  # Configure which authentication keys should be case-insensitive.
42
59
  # These keys will be downcased upon creating or modifying a user and when used
43
60
  # to authenticate or find a user. Default is :email.
44
- config.case_insensitive_keys = [ :email ]
61
+ config.case_insensitive_keys = [:email]
45
62
 
46
63
  # Configure which authentication keys should have whitespace stripped.
47
64
  # These keys will have whitespace before and after removed upon creating or
48
65
  # modifying a user and when used to authenticate or find a user. Default is :email.
49
- config.strip_whitespace_keys = [ :email ]
66
+ config.strip_whitespace_keys = [:email]
50
67
 
51
68
  # Tell if authentication through request.params is enabled. True by default.
52
69
  # It can be set to an array that will enable params authentication only for the
@@ -57,7 +74,10 @@ Devise.setup do |config|
57
74
  # Tell if authentication through HTTP Auth is enabled. False by default.
58
75
  # It can be set to an array that will enable http authentication only for the
59
76
  # given strategies, for example, `config.http_authenticatable = [:database]` will
60
- # enable it only for database authentication. The supported strategies are:
77
+ # enable it only for database authentication.
78
+ # For API-only applications to support authentication "out-of-the-box", you will likely want to
79
+ # enable this with :database unless you are using a custom strategy.
80
+ # The supported strategies are:
61
81
  # :database = Support basic authentication with authentication key + password
62
82
  # config.http_authenticatable = false
63
83
 
@@ -85,23 +105,38 @@ Devise.setup do |config|
85
105
  # from the server. You can disable this option at your own risk.
86
106
  # config.clean_up_csrf_token_on_authentication = true
87
107
 
108
+ # When false, Devise will not attempt to reload routes on eager load.
109
+ # This can reduce the time taken to boot the app but if your application
110
+ # requires the Devise mappings to be loaded during boot time the application
111
+ # won't boot properly.
112
+ # config.reload_routes = true
113
+
88
114
  # ==> Configuration for :database_authenticatable
89
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
90
- # using other encryptors, it sets how many times you want the password re-encrypted.
115
+ # For bcrypt, this is the cost for hashing the password and defaults to 12. If
116
+ # using other algorithms, it sets how many times you want the password to be hashed.
117
+ # The number of stretches used for generating the hashed password are stored
118
+ # with the hashed password. This allows you to change the stretches without
119
+ # invalidating existing passwords.
91
120
  #
92
121
  # Limiting the stretches to just one in testing will increase the performance of
93
122
  # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
94
123
  # a value less than 10 in other environments. Note that, for bcrypt (the default
95
- # encryptor), the cost increases exponentially with the number of stretches (e.g.
124
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
96
125
  # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
97
- config.stretches = Rails.env.test? ? 1 : 10
126
+ config.stretches = Rails.env.test? ? 1 : 12
127
+
128
+ # Set up a pepper to generate the hashed password.
129
+ # config.pepper = '62cbb0ca9d6754a3b7506524344a3af5d57ed6674858a00a2bf44ff7024655123072f018c948bad0183cb5430eec3cdf20bd19457a7538e8951a66c362f6f316'
98
130
 
99
- # Setup a pepper to generate the encrypted password.
100
- # config.pepper = '42146cddf6763d99c8e4a075b57def6c863e24afa438ec58043c338b74e0a4aaae0e9ea7f02af9bd1b3a3c7593eabe8fa147218f2614ddfa696b7c284af5c112'
131
+ # Send a notification to the original email when the user's email is changed.
132
+ # config.send_email_changed_notification = false
133
+
134
+ # Send a notification email when the user's password is changed.
135
+ # config.send_password_change_notification = false
101
136
 
102
137
  # ==> Configuration for :invitable
103
- # The period the generated invitation token is valid, after
104
- # this period, the invited resource won't be able to accept the invitation.
138
+ # The period the generated invitation token is valid.
139
+ # After this period, the invited resource won't be able to accept the invitation.
105
140
  # When invite_for is 0 (the default), the invitation won't expire.
106
141
  # config.invite_for = 2.weeks
107
142
 
@@ -117,10 +152,11 @@ Devise.setup do |config|
117
152
 
118
153
  # The key to be used to check existing users when sending an invitation
119
154
  # and the regexp used to test it when validate_on_invite is not set.
120
- # config.invite_key = {:email => /\A[^@]+@[^@]+\z/}
121
- # config.invite_key = {:email => /\A[^@]+@[^@]+\z/, :username => nil}
155
+ # config.invite_key = { email: /\A[^@]+@[^@]+\z/ }
156
+ # config.invite_key = { email: /\A[^@]+@[^@]+\z/, username: nil }
122
157
 
123
- # Flag that force a record to be valid before being actually invited
158
+ # Ensure that invited record is valid.
159
+ # The invitation won't be sent if this check fails.
124
160
  # Default: false
125
161
  # config.validate_on_invite = true
126
162
 
@@ -133,17 +169,29 @@ Devise.setup do |config|
133
169
  # Default: nil
134
170
  # config.invited_by_class_name = 'User'
135
171
 
172
+ # The foreign key to the inviting model (if invited_by_class_name is set)
173
+ # Default: :invited_by_id
174
+ # config.invited_by_foreign_key = :invited_by_id
175
+
136
176
  # The column name used for counter_cache column. If this is nil,
137
177
  # the #invited_by association is declared without counter_cache.
138
178
  # Default: nil
139
179
  # config.invited_by_counter_cache = :invitations_count
140
180
 
181
+ # Auto-login after the user accepts the invite. If this is false,
182
+ # the user will need to manually log in after accepting the invite.
183
+ # Default: true
184
+ # config.allow_insecure_sign_in_after_accept = false
185
+
141
186
  # ==> Configuration for :confirmable
142
187
  # A period that the user is allowed to access the website even without
143
188
  # confirming their account. For instance, if set to 2.days, the user will be
144
189
  # able to access the website for two days without confirming their account,
145
- # access will be blocked just in the third day. Default is 0.days, meaning
146
- # the user cannot access the website without confirming their account.
190
+ # access will be blocked just in the third day.
191
+ # You can also set it to nil, which will allow the user to access the website
192
+ # without confirming their account.
193
+ # Default is 0.days, meaning the user cannot access the website without
194
+ # confirming their account.
147
195
  # config.allow_unconfirmed_access_for = 2.days
148
196
 
149
197
  # A period that the user is allowed to confirm their account before their
@@ -161,7 +209,7 @@ Devise.setup do |config|
161
209
  config.reconfirmable = true
162
210
 
163
211
  # Defines which key will be used when confirming an account
164
- # config.confirmation_keys = [ :email ]
212
+ # config.confirmation_keys = [:email]
165
213
 
166
214
  # ==> Configuration for :rememberable
167
215
  # The time the user will be remembered without asking for credentials again.
@@ -179,21 +227,18 @@ Devise.setup do |config|
179
227
 
180
228
  # ==> Configuration for :validatable
181
229
  # Range for password length.
182
- config.password_length = 8..128
230
+ config.password_length = 6..128
183
231
 
184
232
  # Email regex used to validate email formats. It simply asserts that
185
233
  # one (and only one) @ exists in the given string. This is mainly
186
234
  # to give user feedback and not to assert the e-mail validity.
187
- # config.email_regexp = /\A[^@]+@[^@]+\z/
235
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
188
236
 
189
237
  # ==> Configuration for :timeoutable
190
238
  # The time you want to timeout the user session without activity. After this
191
239
  # time the user will be asked for credentials again. Default is 30 minutes.
192
240
  # config.timeout_in = 30.minutes
193
241
 
194
- # If true, expires auth token on session timeout.
195
- # config.expire_auth_token_on_timeout = false
196
-
197
242
  # ==> Configuration for :lockable
198
243
  # Defines which strategy will be used to lock an account.
199
244
  # :failed_attempts = Locks an account after a number of failed attempts to sign in.
@@ -201,7 +246,7 @@ Devise.setup do |config|
201
246
  # config.lock_strategy = :failed_attempts
202
247
 
203
248
  # Defines which key will be used when locking and unlocking an account
204
- # config.unlock_keys = [ :email ]
249
+ # config.unlock_keys = [:email]
205
250
 
206
251
  # Defines which strategy will be used to unlock an account.
207
252
  # :email = Sends an unlock link to the user email
@@ -223,19 +268,23 @@ Devise.setup do |config|
223
268
  # ==> Configuration for :recoverable
224
269
  #
225
270
  # Defines which key will be used when recovering the password for an account
226
- # config.reset_password_keys = [ :email ]
271
+ # config.reset_password_keys = [:email]
227
272
 
228
273
  # Time interval you can reset your password with a reset password key.
229
274
  # Don't put a too small interval or your users won't have the time to
230
275
  # change their passwords.
231
276
  config.reset_password_within = 6.hours
232
277
 
278
+ # When set to false, does not sign a user in automatically after their password is
279
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
280
+ # config.sign_in_after_reset_password = true
281
+
233
282
  # ==> Configuration for :encryptable
234
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
235
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
236
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
237
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
238
- # REST_AUTH_SITE_KEY to pepper).
283
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
284
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
285
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
286
+ # for default behavior) and :restful_authentication_sha1 (then you should set
287
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
239
288
  #
240
289
  # Require the `devise-encryptable` gem when using anything other than bcrypt
241
290
  # config.encryptor = :sha512
@@ -292,7 +341,20 @@ Devise.setup do |config|
292
341
  # The router that invoked `devise_for`, in the example above, would be:
293
342
  # config.router_name = :my_engine
294
343
  #
295
- # When using omniauth, Devise cannot automatically set Omniauth path,
344
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
296
345
  # so you need to do it manually. For the users scope, it would be:
297
346
  # config.omniauth_path_prefix = '/my_engine/users/auth'
347
+
348
+ # ==> Turbolinks configuration
349
+ # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
350
+ #
351
+ # ActiveSupport.on_load(:devise_failure_app) do
352
+ # include Turbolinks::Controller
353
+ # end
354
+
355
+ # ==> Configuration for :registerable
356
+
357
+ # When set to false, does not sign a user in automatically after their password is
358
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
359
+ # config.sign_in_after_change_password = true
298
360
  end