diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-20 17:27:41 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-02-20 17:27:41 +0300 |
commit | b574d97c2ee5ea926342b6ef00d9c22c1cc7ebdd (patch) | |
tree | 3e71afab323f4677b142ed6e9f45e6ecab226b1e /lib/pleroma/web/router.ex | |
parent | 6fe7acd58ecf2e12bc03499ba43351ff111d4385 (diff) | |
download | pleroma-b574d97c2ee5ea926342b6ef00d9c22c1cc7ebdd.tar.gz |
[#468] Added support for `push` OAuth scope (Mastodon 2.4+).
Diffstat (limited to 'lib/pleroma/web/router.ex')
-rw-r--r-- | lib/pleroma/web/router.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 562e24ad9..559d3aa0c 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -93,6 +93,10 @@ defmodule Pleroma.Web.Router do plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: ["follow"]}) end + pipeline :oauth_push do + plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: ["push"]}) + end + pipeline :well_known do plug(:accepts, ["json", "jrd+json", "xml", "xrd+xml"]) end @@ -290,6 +294,10 @@ defmodule Pleroma.Web.Router do post("/domain_blocks", MastodonAPIController, :block_domain) delete("/domain_blocks", MastodonAPIController, :unblock_domain) + end + + scope [] do + pipe_through(:oauth_push) post("/push/subscription", MastodonAPIController, :create_push_subscription) get("/push/subscription", MastodonAPIController, :get_push_subscription) |