Skip to content

Commit 6e4c678

Browse files
authored
Merge pull request #3131 from projectblacklight/backport-secrets
[backport] Use the new method for getting secret_key_base
2 parents b360480 + 49a037c commit 6e4c678

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

app/controllers/concerns/blacklight/token_based_user.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,7 @@ def export_secret_token
4848
end
4949

5050
def secret_key_generator
51-
@secret_key_generator ||= begin
52-
app = Rails.application
53-
54-
secret_key_base = if app.respond_to?(:credentials)
55-
# Rails 5.2+
56-
app.credentials.secret_key_base
57-
else
58-
# Rails <= 5.1
59-
app.secrets.secret_key_base
60-
end
61-
ActiveSupport::KeyGenerator.new(secret_key_base)
62-
end
51+
@secret_key_generator ||= ActiveSupport::KeyGenerator.new(Rails.application.secret_key_base)
6352
end
6453

6554
def message_encryptor

0 commit comments

Comments
 (0)