From fd0d4e172ff37dfcb647570c32b9374021d096f4 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 19 Jan 2024 09:16:32 -0600 Subject: [PATCH] Simplify SecretKeyFinder Rails back to 6.0 has Rails.application.secret_key_base. We don't need all these conditionals anymore. --- lib/devise/secret_key_finder.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/devise/secret_key_finder.rb b/lib/devise/secret_key_finder.rb index d07106c44b..be240f22c7 100644 --- a/lib/devise/secret_key_finder.rb +++ b/lib/devise/secret_key_finder.rb @@ -7,15 +7,7 @@ def initialize(application) end 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 - end + @application.secret_key_base end private