Skip to content

Commit

Permalink
Simplify SecretKeyFinder
Browse files Browse the repository at this point in the history
Rails back to 6.0 has Rails.application.secret_key_base.  We don't need all these conditionals anymore.
  • Loading branch information
jcoyne committed Jan 19, 2024
1 parent e2242a9 commit fd0d4e1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/devise/secret_key_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd0d4e1

Please sign in to comment.