Skip to content

Commit

Permalink
workaround to continue using plaintext config/secrets.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Dec 2, 2024
1 parent 26ee3c8 commit 0eb9aa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/playback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_cookie
'sub' => resource_path,
'exp' => expires,
}
secret = Rails.application.secret_key_base
secret = Rails.configuration.secrets.secret_key_base
token = JWT.encode(payload, secret, 'HS256')

cookies[cookie_name] = {
Expand All @@ -74,7 +74,7 @@ def verify_cookie
raise RecordingNotFoundError if cookie.blank?

resource_path = "/#{@playback_format.format}/#{@recording.record_id}"
secret = Rails.application.secret_key_base
secret = Rails.configuration.secrets.secret_key_base
JWT.decode(
cookie,
secret,
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@ class Application < Rails::Application

# Restore default serializer from Rails defaults < 7.1
config.active_record.default_column_serializer = YAML

# continue using config/secrets.yml for secrets
config.secrets = config_for(:secrets)
end
end

0 comments on commit 0eb9aa5

Please sign in to comment.