mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-29 03:46:04 +01:00
can be changed in runtime
This commit is contained in:
parent
6252e82f85
commit
de4102b247
@ -7,10 +7,6 @@ defmodule Pleroma.Web.MastodonAPI.AppView do
|
||||
|
||||
alias Pleroma.Web.OAuth.App
|
||||
|
||||
@vapid_key :web_push_encryption
|
||||
|> Application.get_env(:vapid_details, [])
|
||||
|> Keyword.get(:public_key)
|
||||
|
||||
def render("show.json", %{app: %App{} = app}) do
|
||||
%{
|
||||
id: app.id |> to_string,
|
||||
@ -32,8 +28,10 @@ defmodule Pleroma.Web.MastodonAPI.AppView do
|
||||
end
|
||||
|
||||
defp with_vapid_key(data) do
|
||||
if @vapid_key do
|
||||
Map.put(data, "vapid_key", @vapid_key)
|
||||
vapid_key = Application.get_env(:web_push_encryption, :vapid_details, [])[:public_key]
|
||||
|
||||
if vapid_key do
|
||||
Map.put(data, "vapid_key", vapid_key)
|
||||
else
|
||||
data
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user