Skip to content

Commit 01775b4

Browse files
committed
deps: Run rails generate devise:install again after updates.
1 parent 5c3297d commit 01775b4

File tree

2 files changed

+90
-29
lines changed

2 files changed

+90
-29
lines changed

config/initializers/devise.rb

Lines changed: 82 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
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+
#
19
# Use this hook to configure devise mailer, warden hooks and so forth.
210
# Many of these configuration options can be set straight in your model.
3-
# require 'yaml'
411
Devise.setup do |config|
512
# The secret key used by Devise. Devise uses this key to generate
613
# random tokens. Changing this key will render invalid all existing
714
# 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.
817
config.secret_key = 'e3d273e475a92c4e5740edcc43dd7977982e7712f44d8be4cfcc9f9f64367950c01ff311c61d0465b59922fe033f8daf95411e7313e9e090932006325987ca94'
918

19+
# ==> Controller configuration
20+
# Configure the parent class to the devise controllers.
21+
# config.parent_controller = 'DeviseController'
22+
1023
# ==> Mailer Configuration
1124
# Configure the e-mail address which will be shown in Devise::Mailer,
1225
# note that it will be overwritten if you use your own mailer class
@@ -16,6 +29,9 @@
1629
# Configure the class responsible to send e-mails.
1730
# config.mailer = 'Devise::Mailer'
1831

32+
# Configure the parent class responsible to send e-mails.
33+
# config.parent_mailer = 'ActionMailer::Base'
34+
1935
# ==> ORM configuration
2036
# Load and configure the ORM. Supports :active_record (default) and
2137
# :mongoid (bson_ext recommended) by default. Other ORMs may be
@@ -30,7 +46,7 @@
3046
# session. If you need permissions, you should implement that in a before filter.
3147
# You can also supply a hash where the value is a boolean determining whether
3248
# or not authentication should be aborted when the value is not present.
33-
config.authentication_keys = [ :name ]
49+
config.authentication_keys = [:name]
3450

3551
# Configure parameters from the request object used for authentication. Each entry
3652
# given should be a request method and it will automatically be passed to the
@@ -42,12 +58,12 @@
4258
# Configure which authentication keys should be case-insensitive.
4359
# These keys will be downcased upon creating or modifying a user and when used
4460
# to authenticate or find a user. Default is :email.
45-
config.case_insensitive_keys = [ ]
61+
config.case_insensitive_keys = []
4662

4763
# Configure which authentication keys should have whitespace stripped.
4864
# These keys will have whitespace before and after removed upon creating or
4965
# 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 = []
5167

5268
# Tell if authentication through request.params is enabled. True by default.
5369
# It can be set to an array that will enable params authentication only for the
@@ -58,7 +74,10 @@
5874
# Tell if authentication through HTTP Auth is enabled. False by default.
5975
# It can be set to an array that will enable http authentication only for the
6076
# 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:
6281
# :database = Support basic authentication with authentication key + password
6382
# config.http_authenticatable = false
6483

@@ -86,26 +105,44 @@
86105
# from the server. You can disable this option at your own risk.
87106
# config.clean_up_csrf_token_on_authentication = true
88107

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+
89114
# ==> 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.
92120
#
93121
# Limiting the stretches to just one in testing will increase the performance of
94122
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
95123
# 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.
97125
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
98126
config.stretches = Rails.env.test? ? 1 : 10
99127

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
102136

103137
# ==> Configuration for :confirmable
104138
# A period that the user is allowed to access the website even without
105139
# confirming their account. For instance, if set to 2.days, the user will be
106140
# 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.
109146
# config.allow_unconfirmed_access_for = 2.days
110147

111148
# A period that the user is allowed to confirm their account before their
@@ -120,10 +157,10 @@
120157
# initial account confirmation) to be applied. Requires additional unconfirmed_email
121158
# db field (see migrations). Until confirmed, new email is stored in
122159
# unconfirmed_email column, and copied to email column on successful confirmation.
123-
# config.reconfirmable = true
160+
config.reconfirmable = true
124161

125162
# Defines which key will be used when confirming an account
126-
# config.confirmation_keys = [ :email ]
163+
# config.confirmation_keys = [:email]
127164

128165
# ==> Configuration for :rememberable
129166
# The time the user will be remembered without asking for credentials again.
@@ -141,12 +178,12 @@
141178

142179
# ==> Configuration for :validatable
143180
# Range for password length.
144-
config.password_length = 8..128
181+
config.password_length = 6..128
145182

146183
# Email regex used to validate email formats. It simply asserts that
147184
# one (and only one) @ exists in the given string. This is mainly
148185
# 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/
150187

151188
# ==> Configuration for :timeoutable
152189
# The time you want to timeout the user session without activity. After this
@@ -163,7 +200,7 @@
163200
# config.lock_strategy = :failed_attempts
164201

165202
# Defines which key will be used when locking and unlocking an account
166-
# config.unlock_keys = [ :email ]
203+
# config.unlock_keys = [:email]
167204

168205
# Defines which strategy will be used to unlock an account.
169206
# :email = Sends an unlock link to the user email
@@ -185,19 +222,23 @@
185222
# ==> Configuration for :recoverable
186223
#
187224
# 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]
189226

190227
# Time interval you can reset your password with a reset password key.
191228
# Don't put a too small interval or your users won't have the time to
192229
# change their passwords.
193230
config.reset_password_within = 6.hours
194231

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+
195236
# ==> 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).
201242
#
202243
# Require the `devise-encryptable` gem when using anything other than bcrypt
203244
# config.encryptor = :sha512
@@ -218,14 +259,14 @@
218259

219260
# ==> Navigation configuration
220261
# 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
222263
# access, but formats like :xml or :json, should return 401.
223264
#
224265
# If you have any extra navigational formats, like :iphone or :mobile, you
225266
# should add them to the navigational formats lists.
226267
#
227268
# The "*/*" below is required to match Internet Explorer requests.
228-
# config.navigational_formats = ['*/*', :html]
269+
# config.navigational_formats = ['*/*', :html, :turbo_stream]
229270

230271
# The default HTTP method used to sign out a resource. Default is :delete.
231272
config.sign_out_via = :get
@@ -254,7 +295,22 @@
254295
# The router that invoked `devise_for`, in the example above, would be:
255296
# config.router_name = :my_engine
256297
#
257-
# When using omniauth, Devise cannot automatically set Omniauth path,
298+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
258299
# so you need to do it manually. For the users scope, it would be:
259300
# 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
260316
end

config/locales/devise.en.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
1+
# Additional translations at https://github.com/heartcombo/devise/wiki/I18n
22

33
en:
44
devise:
@@ -23,8 +23,12 @@ en:
2323
subject: "Reset password instructions"
2424
unlock_instructions:
2525
subject: "Unlock instructions"
26+
email_changed:
27+
subject: "Email Changed"
28+
password_change:
29+
subject: "Password Changed"
2630
omniauth_callbacks:
27-
failure: 'Could not authenticate you from %{kind} because "%{reason}".'
31+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
2832
success: "Successfully authenticated from %{kind} account."
2933
passwords:
3034
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
@@ -38,8 +42,9 @@ en:
3842
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
3943
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
4044
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41-
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
45+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
4246
updated: "Your account has been updated successfully."
47+
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
4348
sessions:
4449
signed_in: "Signed in successfully."
4550
signed_out: "Signed out successfully."

0 commit comments

Comments
 (0)