Add Twitter API verify_credentials endpoint.
This commit is contained in:
parent
980717fdce
commit
093fd1832d
3 changed files with 71 additions and 1 deletions
18
lib/pleroma/web/twitter_api/twitter_api_controller.ex
Normal file
18
lib/pleroma/web/twitter_api/twitter_api_controller.ex
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
defmodule Pleroma.Web.TwitterAPI.Controller do
|
||||
use Pleroma.Web, :controller
|
||||
|
||||
alias Pleroma.Web.TwitterAPI.Representers.UserRepresenter
|
||||
|
||||
def verify_credentials(%{assigns: %{user: user}} = conn, _params) do
|
||||
response = user |> UserRepresenter.to_json
|
||||
|
||||
conn
|
||||
|> json_reply(200, response)
|
||||
end
|
||||
|
||||
defp json_reply(conn, status, json) do
|
||||
conn
|
||||
|> put_resp_content_type("application/json")
|
||||
|> send_resp(status, json)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue