diff --git a/CHANGELOG.md b/CHANGELOG.md index 5878f75eb..94ecc52ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ### Unreleased * enhancements - * Removed deprecations warning output for `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION` (@soartec-lab) + * Removed deprecations warning output for `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION`. (@soartec-lab) + * `Devise::SecretKeyFinder#find` deprioritizes use of the deprecated find method in `rails`. (@soartec-lab) ### 4.9.2 - 2023-04-03 diff --git a/lib/devise/secret_key_finder.rb b/lib/devise/secret_key_finder.rb index d07106c44..6d3a6c473 100644 --- a/lib/devise/secret_key_finder.rb +++ b/lib/devise/secret_key_finder.rb @@ -9,12 +9,12 @@ def initialize(application) def find if @application.respond_to?(:credentials) && key_exists?(@application.credentials) @application.credentials.secret_key_base - elsif @application.respond_to?(:secrets) && key_exists?(@application.secrets) - @application.secrets.secret_key_base elsif @application.config.respond_to?(:secret_key_base) && key_exists?(@application.config) @application.config.secret_key_base elsif @application.respond_to?(:secret_key_base) && key_exists?(@application) @application.secret_key_base + elsif @application.respond_to?(:secrets) && key_exists?(@application.secrets) + @application.secrets.secret_key_base end end