logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

ensure_user_key_plug.ex (388B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.Plugs.EnsureUserKeyPlug do
  5. import Plug.Conn
  6. def init(opts) do
  7. opts
  8. end
  9. def call(%{assigns: %{user: _}} = conn, _), do: conn
  10. def call(conn, _) do
  11. conn
  12. |> assign(:user, nil)
  13. end
  14. end