postland/lib/postland_web/controllers/webfinger_json.ex
2024-10-11 01:19:29 +00:00

20 lines
483 B
Elixir

defmodule PostlandWeb.WebfingerJSON do
use Phoenix.VerifiedRoutes, endpoint: PostlandWeb.Endpoint, router: PostlandWeb.Router
alias Postland.Accounts
def render("webfinger.json", _assigns) do
user = Accounts.solo_user()
%{
subject: "acct:#{user.username}@#{PostlandWeb.Endpoint.host()}",
links: [
%{
"rel" => "self",
"type" => "application/activity+json",
"href" => url(~p"/actor")
}
]
}
end
end