OAuthPlug, Router: Handle deactivated users in the UserEnabledPlug
authorlain <lain@soykaf.club>
Fri, 15 Nov 2019 13:13:21 +0000 (14:13 +0100)
committerrinpatch <rinpatch@sdf.org>
Tue, 19 Nov 2019 16:24:13 +0000 (19:24 +0300)
lib/pleroma/plugs/oauth_plug.ex
lib/pleroma/web/router.ex

index 86bc4aa3a40db3e54e1125542504d5eac5216258..11a5b764257af45b84f2edd4d72d7bff404f1036 100644 (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
index db660f0dc9e22c45c18f4baaa8e9f5429174cb57..979dea0aab95a0d2eb8cf3d88103b4a2f0cbf897 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