OAuthPlug, Router: Handle deactivated users in the UserEnabledPlug
authorlain <lain@soykaf.club>
Fri, 15 Nov 2019 13:13:21 +0000 (14:13 +0100)
committerlain <lain@soykaf.club>
Fri, 15 Nov 2019 13:13:21 +0000 (14:13 +0100)
lib/pleroma/plugs/oauth_plug.ex
lib/pleroma/web/router.ex

index fd004fcd2fec7730f155945a672c2badd6e9ec79..11a5b764257af45b84f2edd4d72d7bff404f1036 100644 (file)
@@ -71,7 +71,7 @@ defmodule Pleroma.Plugs.OAuthPlug do
       )
 
     # credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
-    with %Token{user: %{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
index 8fb4aec13efab07ad5f7ef3da4da368469d75481..af7c0e2898d4a7bd8bed9e4944858c299ae760e8 100644 (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