else
{:ok, pem} = Salmon.generate_rsa_pem
info = Map.put(info, "keys", pem)
- Repo.update(Ecto.Changeset.change(user, info: info))
+ Ecto.Changeset.change(user, info: info)
+ |> User.update_and_set_cache()
end
end
with {:ok, %{body: body}} <- @httpoison.get("https://#{domain}/.well-known/host-meta", []) do
get_template_from_xml(body)
else
- e -> {:error, "Can't find lrdd template: #{inspect(e)}"}
+ e -> {:error, "Can't find LRDD template: #{inspect(e)}"}
end
end
end
def finger(account) do
+ account = String.trim_leading(account, "@")
domain = with [_name, domain] <- String.split(account, "@") do
domain
else _e ->
{:ok, data}
else
e ->
- Logger.debug(fn -> "Couldn't finger #{account}." end)
+ Logger.debug(fn -> "Couldn't finger #{account}" end)
Logger.debug(fn -> inspect(e) end)
{:error, e}
end