Skip to content

Commit

Permalink
Avoid accessing secret__key_base via secrets
Browse files Browse the repository at this point in the history
Rails.application.secrets is deprecated and issues a bunch of warnings.
  • Loading branch information
jcoyne committed Jun 28, 2024
1 parent 7efc101 commit d9e03b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/stacks_media_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def self.create_from_encrypted_string(encrypted_string)

def self.encryptor
salt = 'media'
key = ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base).generate_key(salt, 32)
key = ActiveSupport::KeyGenerator.new(Rails.application.secret_key_base).generate_key(salt, 32)
ActiveSupport::MessageEncryptor.new(key)
end
private_class_method :encryptor
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def token

def self.encryptor
salt = 'user'
key = ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base).generate_key(salt, 32)
key = ActiveSupport::KeyGenerator.new(Rails.application.secret_key_base).generate_key(salt, 32)
ActiveSupport::MessageEncryptor.new(key)
end

Expand Down

0 comments on commit d9e03b9

Please sign in to comment.