|
| 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 | | -# require 'yaml' |
4 | 11 | Devise.setup do |config| |
5 | 12 | # The secret key used by Devise. Devise uses this key to generate |
6 | 13 | # random tokens. Changing this key will render invalid all existing |
7 | 14 | # confirmation, reset password and unlock tokens in the database. |
| 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. |
8 | 17 | config.secret_key = 'e3d273e475a92c4e5740edcc43dd7977982e7712f44d8be4cfcc9f9f64367950c01ff311c61d0465b59922fe033f8daf95411e7313e9e090932006325987ca94' |
9 | 18 |
|
| 19 | + # ==> Controller configuration |
| 20 | + # Configure the parent class to the devise controllers. |
| 21 | + # config.parent_controller = 'DeviseController' |
| 22 | + |
10 | 23 | # ==> Mailer Configuration |
11 | 24 | # Configure the e-mail address which will be shown in Devise::Mailer, |
12 | 25 | # note that it will be overwritten if you use your own mailer class |
|
16 | 29 | # Configure the class responsible to send e-mails. |
17 | 30 | # config.mailer = 'Devise::Mailer' |
18 | 31 |
|
| 32 | + # Configure the parent class responsible to send e-mails. |
| 33 | + # config.parent_mailer = 'ActionMailer::Base' |
| 34 | + |
19 | 35 | # ==> ORM configuration |
20 | 36 | # Load and configure the ORM. Supports :active_record (default) and |
21 | 37 | # :mongoid (bson_ext recommended) by default. Other ORMs may be |
|
30 | 46 | # session. If you need permissions, you should implement that in a before filter. |
31 | 47 | # You can also supply a hash where the value is a boolean determining whether |
32 | 48 | # or not authentication should be aborted when the value is not present. |
33 | | - config.authentication_keys = [ :name ] |
| 49 | + config.authentication_keys = [:name] |
34 | 50 |
|
35 | 51 | # Configure parameters from the request object used for authentication. Each entry |
36 | 52 | # given should be a request method and it will automatically be passed to the |
|
42 | 58 | # Configure which authentication keys should be case-insensitive. |
43 | 59 | # These keys will be downcased upon creating or modifying a user and when used |
44 | 60 | # to authenticate or find a user. Default is :email. |
45 | | - config.case_insensitive_keys = [ ] |
| 61 | + config.case_insensitive_keys = [] |
46 | 62 |
|
47 | 63 | # Configure which authentication keys should have whitespace stripped. |
48 | 64 | # These keys will have whitespace before and after removed upon creating or |
49 | 65 | # modifying a user and when used to authenticate or find a user. Default is :email. |
50 | | - config.strip_whitespace_keys = [ ] |
| 66 | + config.strip_whitespace_keys = [] |
51 | 67 |
|
52 | 68 | # Tell if authentication through request.params is enabled. True by default. |
53 | 69 | # It can be set to an array that will enable params authentication only for the |
|
58 | 74 | # Tell if authentication through HTTP Auth is enabled. False by default. |
59 | 75 | # It can be set to an array that will enable http authentication only for the |
60 | 76 | # given strategies, for example, `config.http_authenticatable = [:database]` will |
61 | | - # 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: |
62 | 81 | # :database = Support basic authentication with authentication key + password |
63 | 82 | # config.http_authenticatable = false |
64 | 83 |
|
|
86 | 105 | # from the server. You can disable this option at your own risk. |
87 | 106 | # config.clean_up_csrf_token_on_authentication = true |
88 | 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 | + |
89 | 114 | # ==> Configuration for :database_authenticatable |
90 | | - # For bcrypt, this is the cost for hashing the password and defaults to 10. If |
91 | | - # 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. |
92 | 120 | # |
93 | 121 | # Limiting the stretches to just one in testing will increase the performance of |
94 | 122 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use |
95 | 123 | # a value less than 10 in other environments. Note that, for bcrypt (the default |
96 | | - # 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. |
97 | 125 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). |
98 | 126 | config.stretches = Rails.env.test? ? 1 : 10 |
99 | 127 |
|
100 | | - # Setup a pepper to generate the encrypted password. |
101 | | - # config.pepper = 'c6cf09148ea14b14b5bc76ea070d438dc2e7bbda9b2805a382b926062476833f7ca2ebf87f78ab6460bff749695116d1f33e11a1ab7b4b18cbee6736f8e0b942' |
| 128 | + # Set up a pepper to generate the hashed password. |
| 129 | + # config.pepper = '9ce4166d94a2abffe74f523b8c0cb2884c35909749d726a347133894bda7c76d81d7ea60382412bca11c011cfa713e3af2af149a3c0a746bf9814bae4f20acc4' |
| 130 | + |
| 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 |
102 | 136 |
|
103 | 137 | # ==> Configuration for :confirmable |
104 | 138 | # A period that the user is allowed to access the website even without |
105 | 139 | # confirming their account. For instance, if set to 2.days, the user will be |
106 | 140 | # able to access the website for two days without confirming their account, |
107 | | - # access will be blocked just in the third day. Default is 0.days, meaning |
108 | | - # the user cannot access the website without confirming their account. |
| 141 | + # access will be blocked just in the third day. |
| 142 | + # You can also set it to nil, which will allow the user to access the website |
| 143 | + # without confirming their account. |
| 144 | + # Default is 0.days, meaning the user cannot access the website without |
| 145 | + # confirming their account. |
109 | 146 | # config.allow_unconfirmed_access_for = 2.days |
110 | 147 |
|
111 | 148 | # A period that the user is allowed to confirm their account before their |
|
120 | 157 | # initial account confirmation) to be applied. Requires additional unconfirmed_email |
121 | 158 | # db field (see migrations). Until confirmed, new email is stored in |
122 | 159 | # unconfirmed_email column, and copied to email column on successful confirmation. |
123 | | - # config.reconfirmable = true |
| 160 | + config.reconfirmable = true |
124 | 161 |
|
125 | 162 | # Defines which key will be used when confirming an account |
126 | | - # config.confirmation_keys = [ :email ] |
| 163 | + # config.confirmation_keys = [:email] |
127 | 164 |
|
128 | 165 | # ==> Configuration for :rememberable |
129 | 166 | # The time the user will be remembered without asking for credentials again. |
|
141 | 178 |
|
142 | 179 | # ==> Configuration for :validatable |
143 | 180 | # Range for password length. |
144 | | - config.password_length = 8..128 |
| 181 | + config.password_length = 6..128 |
145 | 182 |
|
146 | 183 | # Email regex used to validate email formats. It simply asserts that |
147 | 184 | # one (and only one) @ exists in the given string. This is mainly |
148 | 185 | # to give user feedback and not to assert the e-mail validity. |
149 | | - # config.email_regexp = /\A[^@]+@[^@]+\z/ |
| 186 | + config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ |
150 | 187 |
|
151 | 188 | # ==> Configuration for :timeoutable |
152 | 189 | # The time you want to timeout the user session without activity. After this |
|
163 | 200 | # config.lock_strategy = :failed_attempts |
164 | 201 |
|
165 | 202 | # Defines which key will be used when locking and unlocking an account |
166 | | - # config.unlock_keys = [ :email ] |
| 203 | + # config.unlock_keys = [:email] |
167 | 204 |
|
168 | 205 | # Defines which strategy will be used to unlock an account. |
169 | 206 | # :email = Sends an unlock link to the user email |
|
185 | 222 | # ==> Configuration for :recoverable |
186 | 223 | # |
187 | 224 | # Defines which key will be used when recovering the password for an account |
188 | | - # config.reset_password_keys = [ :email ] |
| 225 | + # config.reset_password_keys = [:email] |
189 | 226 |
|
190 | 227 | # Time interval you can reset your password with a reset password key. |
191 | 228 | # Don't put a too small interval or your users won't have the time to |
192 | 229 | # change their passwords. |
193 | 230 | config.reset_password_within = 6.hours |
194 | 231 |
|
| 232 | + # When set to false, does not sign a user in automatically after their password is |
| 233 | + # reset. Defaults to true, so a user is signed in automatically after a reset. |
| 234 | + # config.sign_in_after_reset_password = true |
| 235 | + |
195 | 236 | # ==> Configuration for :encryptable |
196 | | - # Allow you to use another encryption algorithm besides bcrypt (default). You can use |
197 | | - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, |
198 | | - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) |
199 | | - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy |
200 | | - # REST_AUTH_SITE_KEY to pepper). |
| 237 | + # Allow you to use another hashing or encryption algorithm besides bcrypt (default). |
| 238 | + # You can use :sha1, :sha512 or algorithms from others authentication tools as |
| 239 | + # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 |
| 240 | + # for default behavior) and :restful_authentication_sha1 (then you should set |
| 241 | + # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). |
201 | 242 | # |
202 | 243 | # Require the `devise-encryptable` gem when using anything other than bcrypt |
203 | 244 | # config.encryptor = :sha512 |
|
218 | 259 |
|
219 | 260 | # ==> Navigation configuration |
220 | 261 | # Lists the formats that should be treated as navigational. Formats like |
221 | | - # :html, should redirect to the sign in page when the user does not have |
| 262 | + # :html should redirect to the sign in page when the user does not have |
222 | 263 | # access, but formats like :xml or :json, should return 401. |
223 | 264 | # |
224 | 265 | # If you have any extra navigational formats, like :iphone or :mobile, you |
225 | 266 | # should add them to the navigational formats lists. |
226 | 267 | # |
227 | 268 | # The "*/*" below is required to match Internet Explorer requests. |
228 | | - # config.navigational_formats = ['*/*', :html] |
| 269 | + # config.navigational_formats = ['*/*', :html, :turbo_stream] |
229 | 270 |
|
230 | 271 | # The default HTTP method used to sign out a resource. Default is :delete. |
231 | 272 | config.sign_out_via = :get |
|
254 | 295 | # The router that invoked `devise_for`, in the example above, would be: |
255 | 296 | # config.router_name = :my_engine |
256 | 297 | # |
257 | | - # When using omniauth, Devise cannot automatically set Omniauth path, |
| 298 | + # When using OmniAuth, Devise cannot automatically set OmniAuth path, |
258 | 299 | # so you need to do it manually. For the users scope, it would be: |
259 | 300 | # config.omniauth_path_prefix = '/my_engine/users/auth' |
| 301 | + |
| 302 | + # ==> Hotwire/Turbo configuration |
| 303 | + # When using Devise with Hotwire/Turbo, the http status for error responses |
| 304 | + # and some redirects must match the following. The default in Devise for existing |
| 305 | + # apps is `200 OK` and `302 Found` respectively, but new apps are generated with |
| 306 | + # these new defaults that match Hotwire/Turbo behavior. |
| 307 | + # Note: These might become the new default in future versions of Devise. |
| 308 | + config.responder.error_status = :unprocessable_entity |
| 309 | + config.responder.redirect_status = :see_other |
| 310 | + |
| 311 | + # ==> Configuration for :registerable |
| 312 | + |
| 313 | + # When set to false, does not sign a user in automatically after their password is |
| 314 | + # changed. Defaults to true, so a user is signed in automatically after changing a password. |
| 315 | + # config.sign_in_after_change_password = true |
260 | 316 | end |
0 commit comments