22 lines
544 B
Elixir
22 lines
544 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()
|
||
|
|
|
||
|
|
# TODO: Check that the host here is correct after deploy
|
||
|
|
%{
|
||
|
|
subject: "acct:#{user.username}@#{PostlandWeb.Endpoint.host()}",
|
||
|
|
links: [
|
||
|
|
%{
|
||
|
|
"rel" => "self",
|
||
|
|
"type" => "application/activity+json",
|
||
|
|
"href" => url(~p"/actor")
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
end
|
||
|
|
end
|