logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

auth_expected_plug.ex (404B)


      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 
      5 defmodule Pleroma.Plugs.AuthExpectedPlug do
      6   import Plug.Conn
      7 
      8   def init(options), do: options
      9 
     10   def call(conn, _) do
     11     put_private(conn, :auth_expected, true)
     12   end
     13 
     14   def auth_expected?(conn) do
     15     conn.private[:auth_expected]
     16   end
     17 end