aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-07-12 20:15:27 -0500
committerAlex Gleason <alex@alexgleason.me>2020-07-12 22:55:26 -0500
commite4e557781877c7c3e4f6197cc52963025485dbb3 (patch)
treece3e1376852f93592cd87747f36700d8bdbf2f73 /lib
parent51ab8d0128970dd7458e93578acb36c20b1c185c (diff)
downloadpleroma-e4e557781877c7c3e4f6197cc52963025485dbb3.tar.gz
Prevent unapproved users from logging in
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/oauth/oauth_controller.ex10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex
index 7683589cf..61fe81d33 100644
--- a/lib/pleroma/web/oauth/oauth_controller.ex
+++ b/lib/pleroma/web/oauth/oauth_controller.ex
@@ -337,6 +337,16 @@ defmodule Pleroma.Web.OAuth.OAuthController do
)
end
+ defp handle_token_exchange_error(%Plug.Conn{} = conn, {:account_status, :approval_pending}) do
+ render_error(
+ conn,
+ :forbidden,
+ "Your account is awaiting approval.",
+ %{},
+ "awaiting_approval"
+ )
+ end
+
defp handle_token_exchange_error(%Plug.Conn{} = conn, _error) do
render_invalid_credentials_error(conn)
end