diff options
-rw-r--r-- | README.md | 13 | ||||
-rwxr-xr-x | installation/init.d/pleroma | 2 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/oauth/fallback_controller.ex | 3 | ||||
-rw-r--r-- | test/web/oauth/oauth_controller_test.exs | 25 |
5 files changed, 36 insertions, 8 deletions
@@ -8,14 +8,17 @@ Pleroma is written in Elixir, high-performance and can run on small devices like For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md). +Client applications that are committed to supporting Pleroma: + +* Mastalab (Android) +* Tusky (Android) +* Twidere (Android) +* Mast (iOS) +* Amaroq (iOS) + Client applications that are known to work well: -* Twidere -* Tusky -* Mastalab * Pawoo (Android + iOS) -* Subway Tooter -* Amaroq (iOS) * Tootdon (Android + iOS) * Tootle (iOS) * Whalebird (Windows + Mac + Linux) diff --git a/installation/init.d/pleroma b/installation/init.d/pleroma index 9582d65d4..2b211df65 100755 --- a/installation/init.d/pleroma +++ b/installation/init.d/pleroma @@ -12,7 +12,7 @@ export PORT=4000 export MIX_ENV=prod # Ask process to terminate within 30 seconds, otherwise kill it -retry="SIGTERM/30 SIGKILL/5" +retry="SIGTERM/30/SIGKILL/5" pidfile="/var/run/pleroma.pid" diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index d3e30b656..b14ca9f5d 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -54,7 +54,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do "status.json", Map.put(opts, :replied_to_activities, replied_to_activities) ) - |> Enum.filter(fn x -> not is_nil(x) end) end def render( diff --git a/lib/pleroma/web/oauth/fallback_controller.ex b/lib/pleroma/web/oauth/fallback_controller.ex index 1eeda3d24..f0fe3b578 100644 --- a/lib/pleroma/web/oauth/fallback_controller.ex +++ b/lib/pleroma/web/oauth/fallback_controller.ex @@ -9,7 +9,8 @@ defmodule Pleroma.Web.OAuth.FallbackController do # No user/password def call(conn, _) do conn + |> put_status(:unauthorized) |> put_flash(:error, "Invalid Username/Password") - |> OAuthController.authorize(conn.params) + |> OAuthController.authorize(conn.params["authorization"]) end end diff --git a/test/web/oauth/oauth_controller_test.exs b/test/web/oauth/oauth_controller_test.exs index ccd552258..e0d3cb55f 100644 --- a/test/web/oauth/oauth_controller_test.exs +++ b/test/web/oauth/oauth_controller_test.exs @@ -34,6 +34,31 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do assert Repo.get_by(Authorization, token: code) end + test "correctly handles wrong credentials", %{conn: conn} do + user = insert(:user) + app = insert(:oauth_app) + + result = + conn + |> post("/oauth/authorize", %{ + "authorization" => %{ + "name" => user.nickname, + "password" => "wrong", + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "statepassed" + } + }) + |> html_response(:unauthorized) + + # Keep the details + assert result =~ app.client_id + assert result =~ app.redirect_uris + + # Error message + assert result =~ "Invalid" + end + test "issues a token for an all-body request" do user = insert(:user) app = insert(:oauth_app) |