Given a lot of time has passed since the last v4.x release, and there's been many changes (including breaking ones) merged to main, let's go with an "RC" version before doing a final release. If we don't hear any major issues, I plan to release a final version in a couple of weeks.
5.3 KiB
5.0.0.rc - 2025-12-31
-
breaking changes
-
Drop support to Ruby < 2.7
-
Drop support to Rails < 7.0
-
Remove deprecated
:bypassoption fromsign_inhelper, usebypass_sign_ininstead. #5803 -
Remove deprecated
devise_error_messages!helper, userender "devise/shared/error_messages", resource: resourceinstead. #5803 -
Remove deprecated
scopesecond argument fromsign_in(resource, :admin)controller test helper, usesign_in(resource, scope: :admin)instead. #5803 -
Remove deprecated
Devise::TestHelpers, useDevise::Test::ControllerHelpersinstead. #5803 -
Remove deprecated
Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION#5598 -
Remove deprecated
Devise.activerecord51?method. -
Remove
SecretKeyFinderand useapp.secret_key_baseas the default secret key forDevise.secret_keyif a customDevise.secret_keyis not provided.This is potentially a breaking change because Devise previously used the following order to find a secret key:
app.credentials.secret_key_base > app.secrets.secret_key_base > application.config.secret_key_base > application.secret_key_baseNow, it always uses
application.secret_key_base. Make sure you're using the same secret key after the upgrade; otherwise, previously generated tokens forrecoverable,lockable, andconfirmablewill be invalid. #5645 -
Change password instructions button label on devise view from
Send me reset password instructionstoSend me password reset instructions#5515 -
Change
<br>tags separating form elements to wrapping them in<p>tags #5494 -
Replace
[data-turbo-cache=false]with[data-turbo-temporary]ondevise/shared/error_messagespartial. This has been deprecated by Turbo since v7.3.0 (released on Mar 1, 2023).If you are using an older version of Turbo and the default devise template, you'll need to copy it over to your app and change that back to
[data-turbo-cache=false].
-
-
enhancements
-
Add Rails 8 support.
- Routes are lazy-loaded by default in test and development environments now so Devise loads them before
Devise.mappingscall. #5728
- Routes are lazy-loaded by default in test and development environments now so Devise loads them before
-
New apps using Rack 3.1+ will be generated using
config.responder.error_status = :unprocessable_content, since:unprocessable_entityhas been deprecated by Rack.Latest versions of Rails transparently convert
:unprocessable_entity->:unprocessable_content, and Devise will use that in the failure app to avoid Rack deprecation warnings for apps that are configured with:unprocessable_entity. They can also simply change theirerror_statusto:unprocessable_contentin latest Rack versions to avoid the warning. -
Add Ruby 3.4 and 4.0 support.
-
Reenable Mongoid test suite across all Rails 7+ versions, to ensure we continue supporting it. Changes to dirty tracking to support Mongoid 8.0+. #5568
-
Password length validator is changed from
validates_length_of :password, within: password_length, allow_blank: true`to
validates_length_of :password, minimum: proc { password_length.min }, maximum: proc { password_length.max }, allow_blank: trueso it's possible to override
password_lengthat runtime. #5734
-
-
bug fixes
- Make
Devisework withoutActionMailerwhenZeitwerkautoloader is used. #5731 - Handle defaults
:fromand:reply_toas procs correctly by delegating to Rails #5595 - Use
OmniAuth.config.allowed_request_methodsas routing verbs for the auth path #5508 - Handle
onandONas true values to check params #5514 - Fix passing
formatoption todevise_for#5732 - Use
ActiveRecord::SecurityUtils.secure_compareinDevise.secure_compareto match two empty strings correctly. #4829 - Respond with
401 Unauthorizedfor non-navigational requests to destroy the session when there is no authenticated resource. #4878 - Fix incorrect grammar of invalid authentication message with capitalized attributes, e.g.: "Invalid Email or password" => "Invalid email or password". (originally introduced by #4014, released on v4.1.0) #4834
- Make
Please check 4-stable for previous changes.