diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-01-12 12:12:15 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-01-12 12:12:15 -0600 |
commit | 2f5b8fbeb3830759c00675f99d893a92b1d3edb2 (patch) | |
tree | ee7ba90fa0b52e31cc7beeb9335deefbadd94e15 /lib/pleroma/web/twitter_api | |
parent | 933dc120438d14502e4bc4c29db904114fb6e438 (diff) | |
parent | ecb8fe183c5a007e80d7b2b1bfc9ead89dc27cc2 (diff) | |
download | pleroma-2f5b8fbeb3830759c00675f99d893a92b1d3edb2.tar.gz |
Merge branch 'develop' into issue/1354
Diffstat (limited to 'lib/pleroma/web/twitter_api')
-rw-r--r-- | lib/pleroma/web/twitter_api/controllers/util_controller.ex | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex index a61f891c7..f08b9d28c 100644 --- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex @@ -20,7 +20,14 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do plug( OAuthScopesPlug, %{scopes: ["follow", "write:follows"]} - when action in [:do_remote_follow, :follow_import] + when action == :follow_import + ) + + # Note: follower can submit the form (with password auth) not being signed in (having no token) + plug( + OAuthScopesPlug, + %{fallback: :proceed_unauthenticated, scopes: ["follow", "write:follows"]} + when action == :do_remote_follow ) plug(OAuthScopesPlug, %{scopes: ["follow", "write:blocks"]} when action == :blocks_import) @@ -255,7 +262,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do end def delete_account(%{assigns: %{user: user}} = conn, params) do - case CommonAPI.Utils.confirm_current_password(user, params["password"]) do + password = params["password"] || "" + + case CommonAPI.Utils.confirm_current_password(user, password) do {:ok, user} -> User.delete(user) json(conn, %{status: "success"}) |