fix and improve web push; add configuration docs

This commit is contained in:
Egor Kislitsyn 2018-12-07 15:55:28 +07:00 committed by href
commit 658edb166f
No known key found for this signature in database
GPG key ID: EE8296C1A152C325
4 changed files with 32 additions and 19 deletions

View file

@ -5,7 +5,12 @@ defmodule Pleroma.Web.MastodonAPI.PushSubscriptionView do
%{
id: to_string(subscription.id),
endpoint: subscription.endpoint,
alerts: Map.get(subscription.data, "alerts")
alerts: Map.get(subscription.data, "alerts"),
server_key: server_key()
}
end
defp server_key do
Keyword.get(Application.get_env(:web_push_encryption, :vapid_details), :public_key)
end
end