updated error messages for authentication process

This commit is contained in:
Maksim Pechnikov 2020-01-17 14:55:36 +03:00
commit 108a39c876
5 changed files with 149 additions and 73 deletions

View file

@ -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