Skip to content

Commit

Permalink
Use the new method for getting secret_key_base
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 18, 2024
1 parent a36d8fb commit d243927
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/controllers/concerns/blacklight/token_based_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,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 d243927

Please sign in to comment.