1 defmodule Pleroma.Web.Router do
2 use Pleroma.Web, :router
4 alias Pleroma.{Repo, User}
6 def user_fetcher(username) do
7 {:ok, Repo.get_by(User, %{nickname: username})}
11 plug :accepts, ["json"]
14 pipeline :authenticated_api do
15 plug :accepts, ["json"]
17 plug Pleroma.Plugs.AuthenticationPlug, fetcher: &Pleroma.Web.Router.user_fetcher/1
20 scope "/api", Pleroma.Web do
21 pipe_through :authenticated_api
23 post "/account/verify_credentials.json", TwitterAPI.Controller, :verify_credentials
24 post "/statuses/update.json", TwitterAPI.Controller, :status_update