Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / lib / pleroma / plugs / ensure_user_key_plug.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Plugs.EnsureUserKeyPlug do
6 import Plug.Conn
7
8 def init(opts) do
9 opts
10 end
11
12 def call(%{assigns: %{user: _}} = conn, _), do: conn
13
14 def call(conn, _) do
15 conn
16 |> assign(:user, nil)
17 end
18 end