diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-01 14:46:50 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-01 14:46:50 +0300 |
commit | cbe09d94d1e71b2ee5fdce51d3ac014bf69a6b88 (patch) | |
tree | 11bd2f00ebdd903a2237bde2cf01d8e37ad7a8ba /lib/pleroma/web/router.ex | |
parent | dc39d8d3fb941bad9fe26586c321bb00a0b92fe4 (diff) | |
download | pleroma-cbe09d94d1e71b2ee5fdce51d3ac014bf69a6b88.tar.gz |
Added `force_login` authentication option (previously applied by default).
Diffstat (limited to 'lib/pleroma/web/router.ex')
-rw-r--r-- | lib/pleroma/web/router.ex | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 9ccb4e535..8acab304a 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -5,6 +5,11 @@ defmodule Pleroma.Web.Router do use Pleroma.Web, :router + pipeline :oauth do + plug(:fetch_session) + plug(Pleroma.Plugs.OAuthPlug) + end + pipeline :api do plug(:accepts, ["json"]) plug(:fetch_session) @@ -105,10 +110,6 @@ defmodule Pleroma.Web.Router do plug(:accepts, ["json", "xml"]) end - pipeline :oauth do - plug(:accepts, ["html", "json"]) - end - pipeline :pleroma_api do plug(:accepts, ["html", "json"]) end @@ -200,7 +201,11 @@ defmodule Pleroma.Web.Router do end scope "/oauth", Pleroma.Web.OAuth do - get("/authorize", OAuthController, :authorize) + scope [] do + pipe_through(:oauth) + get("/authorize", OAuthController, :authorize) + end + post("/authorize", OAuthController, :create_authorization) post("/token", OAuthController, :token_exchange) post("/revoke", OAuthController, :token_revoke) |