forked from mirrors/akkoma
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
|
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
|
def render("show.json", %{app: %App{} = app}) do
|
||||||
%{
|
%{
|
||||||
id: app.id |> to_string,
|
id: app.id |> to_string,
|
||||||
|
@ -32,8 +28,10 @@ def render("short.json", %{app: %App{website: webiste, client_name: name}}) do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp with_vapid_key(data) do
|
defp with_vapid_key(data) do
|
||||||
if @vapid_key do
|
vapid_key = Application.get_env(:web_push_encryption, :vapid_details, [])[:public_key]
|
||||||
Map.put(data, "vapid_key", @vapid_key)
|
|
||||||
|
if vapid_key do
|
||||||
|
Map.put(data, "vapid_key", vapid_key)
|
||||||
else
|
else
|
||||||
data
|
data
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue