aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/router.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/router.ex')
-rw-r--r--lib/pleroma/web/router.ex9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index 1e865b358..0440af8c1 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -9,12 +9,19 @@ defmodule Pleroma.Web.Router do
pipeline :api do
plug :accepts, ["json"]
+ plug :fetch_session
+ plug Pleroma.Plugs.AuthenticationPlug, %{fetcher: &Pleroma.Web.Router.user_fetcher/1, optional: true}
end
pipeline :authenticated_api do
plug :accepts, ["json"]
plug :fetch_session
- plug Pleroma.Plugs.AuthenticationPlug, fetcher: &Pleroma.Web.Router.user_fetcher/1
+ plug Pleroma.Plugs.AuthenticationPlug, %{fetcher: &Pleroma.Web.Router.user_fetcher/1}
+ end
+
+ scope "/api", Pleroma.Web do
+ pipe_through :api
+ get "/statuses/public_timeline.json", TwitterAPI.Controller, :public_timeline
end
scope "/api", Pleroma.Web do