Fix preferredUsername of internal.fetch actor
This commit is contained in:
parent
48ce0783ec
commit
24e0815251
1 changed files with 4 additions and 2 deletions
|
@ -67,8 +67,10 @@ def render("service.json", %{user: user}) do
|
|||
def render("user.json", %{user: %User{nickname: nil} = user}),
|
||||
do: render("service.json", %{user: user})
|
||||
|
||||
def render("user.json", %{user: %User{nickname: "internal." <> _} = user}),
|
||||
do: render("service.json", %{user: user}) |> Map.put("preferredUsername", user.nickname)
|
||||
def render("user.json", %{user: %User{nickname: "internal." <> _} = user}) do
|
||||
nickname = user.nickname |> String.split("@") |> List.first()
|
||||
render("service.json", %{user: user}) |> Map.put("preferredUsername", nickname)
|
||||
end
|
||||
|
||||
def render("user.json", %{user: user}) do
|
||||
{:ok, _, public_key} = Keys.keys_from_pem(user.keys)
|
||||
|
|
Loading…
Reference in a new issue