diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-25 10:39:10 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-25 10:39:10 +0300 |
commit | de4102b2475f46fff238cfa3aec7aae1bdfd60f4 (patch) | |
tree | b8178987598b9ec84a734294a16caca5b0f7fb93 | |
parent | 6252e82f85d84c909871d3741da5c835ca2ca944 (diff) | |
download | pleroma-de4102b2475f46fff238cfa3aec7aae1bdfd60f4.tar.gz |
can be changed in runtime
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/app_view.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/app_view.ex b/lib/pleroma/web/mastodon_api/views/app_view.ex index f52b693a6..beba89edb 100644 --- a/lib/pleroma/web/mastodon_api/views/app_view.ex +++ b/lib/pleroma/web/mastodon_api/views/app_view.ex @@ -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 |