OAuthPlug, Router: Handle deactivated users in the UserEnabledPlug

This commit is contained in:
lain 2019-11-15 14:13:21 +01:00 committed by rinpatch
parent 5b5f855237
commit 4079ed3b75
2 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,7 @@ defmodule Pleroma.Plugs.OAuthPlug do
)
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
with %Token{user: %{info: %{deactivated: false} = _} = user} = token_record <- Repo.one(query) do
with %Token{user: user} = token_record <- Repo.one(query) do
{:ok, user, token_record}
end
end

View File

@ -13,6 +13,7 @@ defmodule Pleroma.Web.Router do
pipeline :oauth do
plug(:fetch_session)
plug(Pleroma.Plugs.OAuthPlug)
plug(Pleroma.Plugs.UserEnabledPlug)
end
pipeline :api do