X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fplugs%2Fuser_enabled_plug.ex;h=23e800a74740c6c3ccee0d130400857522985ba4;hb=bd40880fa0ed328c2948bb145354a8292fe051b5;hp=8d102ee5b8d47207aa1e527c79f47866326f9b90;hpb=f6056e9c9cdb280238845e4c9a0d2a1fb82cab78;p=akkoma
diff --git a/lib/pleroma/plugs/user_enabled_plug.ex b/lib/pleroma/plugs/user_enabled_plug.ex
index 8d102ee5b..23e800a74 100644
--- a/lib/pleroma/plugs/user_enabled_plug.ex
+++ b/lib/pleroma/plugs/user_enabled_plug.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserEnabledPlug do
@@ -11,11 +11,9 @@ defmodule Pleroma.Plugs.UserEnabledPlug do
end
def call(%{assigns: %{user: %User{} = user}} = conn, _) do
- if User.auth_active?(user) do
- conn
- else
- conn
- |> assign(:user, nil)
+ case User.account_status(user) do
+ :active -> conn
+ _ -> assign(conn, :user, nil)
end
end