aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth/oauth_controller.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-03-26 15:09:06 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-03-26 15:09:06 +0300
commit263ca3dea2620aa54d3b21b286e1bc1f8f3ed998 (patch)
tree6bd54a2bf76c4fc24d211fdfe7a7880f58535096 /lib/pleroma/web/oauth/oauth_controller.ex
parent15aa94f40f73444d67da7cb71ec219b97ec5142e (diff)
downloadpleroma-263ca3dea2620aa54d3b21b286e1bc1f8f3ed998.tar.gz
Mastodon-based auth error messages. Defaulted User#auth_active?/1 to `true`.
Diffstat (limited to 'lib/pleroma/web/oauth/oauth_controller.ex')
-rw-r--r--lib/pleroma/web/oauth/oauth_controller.ex9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex
index d151efe9e..be56f460a 100644
--- a/lib/pleroma/web/oauth/oauth_controller.ex
+++ b/lib/pleroma/web/oauth/oauth_controller.ex
@@ -83,14 +83,16 @@ defmodule Pleroma.Web.OAuth.OAuthController do
end
else
{scopes_issue, _} when scopes_issue in [:unsupported_scopes, :missing_scopes] ->
+ # Per https://github.com/tootsuite/mastodon/blob/51e154f5e87968d6bb115e053689767ab33e80cd/app/controllers/api/base_controller.rb#L39
conn
- |> put_flash(:error, "Permissions not specified.")
+ |> put_flash(:error, "This action is outside the authorized scopes")
|> put_status(:unauthorized)
|> authorize(auth_params)
{:auth_active, false} ->
+ # Per https://github.com/tootsuite/mastodon/blob/51e154f5e87968d6bb115e053689767ab33e80cd/app/controllers/api/base_controller.rb#L76
conn
- |> put_flash(:error, "Account confirmation pending.")
+ |> put_flash(:error, "Your login is missing a confirmed e-mail address")
|> put_status(:forbidden)
|> authorize(auth_params)
@@ -149,9 +151,10 @@ defmodule Pleroma.Web.OAuth.OAuthController do
json(conn, response)
else
{:auth_active, false} ->
+ # Per https://github.com/tootsuite/mastodon/blob/51e154f5e87968d6bb115e053689767ab33e80cd/app/controllers/api/base_controller.rb#L76
conn
|> put_status(:forbidden)
- |> json(%{error: "Account confirmation pending"})
+ |> json(%{error: "Your login is missing a confirmed e-mail address"})
_error ->
put_status(conn, 400)