Skip to content

Commit

Permalink
Use Rails.application.secret_key_base directly (#2417)
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins authored Jan 27, 2024
1 parent 92a8165 commit 7cb02f5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/avo/services/encryption_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ def decrypt
private

def encryption_key
secret_key_base[0..31]
Rails.application.secret_key_base[0..31]
rescue
# This will fail the decryption process.
# It's here only to keep Avo from crashing
SecureRandom.random_bytes(32)
end

def secret_key_base
ENV["SECRET_KEY_BASE"] || Rails.application.credentials.secret_key_base || Rails.application.secrets.secret_key_base
end
end
end
end

0 comments on commit 7cb02f5

Please sign in to comment.