Use config_for
for VAPID key storage (#34845)
This commit is contained in:
parent
a1c260696f
commit
f7a3dd0e38
15 changed files with 42 additions and 40 deletions
|
@ -79,8 +79,8 @@ class WebPushRequest
|
|||
|
||||
def vapid_key
|
||||
@vapid_key ||= Webpush::VapidKey.from_keys(
|
||||
Rails.configuration.x.vapid_public_key,
|
||||
Rails.configuration.x.vapid_private_key
|
||||
Rails.configuration.x.vapid.public_key,
|
||||
Rails.configuration.x.vapid.private_key
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -18,6 +18,6 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def vapid_key
|
||||
Rails.configuration.x.vapid_public_key
|
||||
Rails.configuration.x.vapid.public_key
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,7 +65,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||
},
|
||||
|
||||
vapid: {
|
||||
public_key: Rails.configuration.x.vapid_public_key,
|
||||
public_key: Rails.configuration.x.vapid.public_key,
|
||||
},
|
||||
|
||||
accounts: {
|
||||
|
|
|
@ -10,7 +10,7 @@ class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def server_key
|
||||
Rails.configuration.x.vapid_public_key
|
||||
Rails.configuration.x.vapid.public_key
|
||||
end
|
||||
|
||||
def policy
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
- if user_signed_in?
|
||||
%meta{ name: 'initialPath', content: request.path }
|
||||
|
||||
%meta{ name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key }
|
||||
%meta{ name: 'applicationServerKey', content: Rails.configuration.x.vapid.public_key }
|
||||
|
||||
= render_initial_state
|
||||
= vite_typescript_tag 'application.ts', crossorigin: 'anonymous'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue