diff options
| author | Alex Gleason <alex@alexgleason.me> | 2020-07-12 20:15:27 -0500 | 
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2020-07-12 22:55:26 -0500 | 
| commit | e4e557781877c7c3e4f6197cc52963025485dbb3 (patch) | |
| tree | ce3e1376852f93592cd87747f36700d8bdbf2f73 /lib | |
| parent | 51ab8d0128970dd7458e93578acb36c20b1c185c (diff) | |
| download | pleroma-e4e557781877c7c3e4f6197cc52963025485dbb3.tar.gz pleroma-e4e557781877c7c3e4f6197cc52963025485dbb3.zip | |
Prevent unapproved users from logging in
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 10 | 
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 | 
