Skip to content

Commit

Permalink
Merge pull request #3131 from projectblacklight/backport-secrets
Browse files Browse the repository at this point in the history
[backport] Use the new method for getting secret_key_base
  • Loading branch information
jcoyne committed Jan 22, 2024
2 parents b360480 + 49a037c commit 6e4c678
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/controllers/concerns/blacklight/token_based_user.rb
Expand Up @@ -48,18 +48,7 @@ def export_secret_token
end

def secret_key_generator
@secret_key_generator ||= begin
app = Rails.application

secret_key_base = if app.respond_to?(:credentials)
# Rails 5.2+
app.credentials.secret_key_base
else
# Rails <= 5.1
app.secrets.secret_key_base
end
ActiveSupport::KeyGenerator.new(secret_key_base)
end
@secret_key_generator ||= ActiveSupport::KeyGenerator.new(Rails.application.secret_key_base)
end

def message_encryptor
Expand Down

0 comments on commit 6e4c678

Please sign in to comment.