logo

pleroma

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

user_enabled_plug.ex (528B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.Plugs.UserEnabledPlug do
  5. alias Pleroma.Helpers.AuthHelper
  6. alias Pleroma.User
  7. def init(options) do
  8. options
  9. end
  10. def call(%{assigns: %{user: %User{} = user}} = conn, _) do
  11. if User.account_status(user) == :active do
  12. conn
  13. else
  14. AuthHelper.drop_auth_info(conn)
  15. end
  16. end
  17. def call(conn, _) do
  18. conn
  19. end
  20. end