user_info = User.get_cached_user_info(user)
- %{
+ data = %{
"created_at" => user.inserted_at |> Utils.format_naive_asctime,
"description" => HtmlSanitizeEx.strip_tags(user.bio),
"favourites_count" => 0,
"cover_photo" => image_url(user.info["banner"]) |> MediaProxy.url(),
"background_image" => image_url(user.info["background"]) |> MediaProxy.url(),
}
+
+ if assigns[:token] do
+ Map.put(data, "token", assigns[:token])
+ else
+ data
+ end
end
def render("short.json", %{user: %User{