Skip to content
Snippets Groups Projects
Commit cc878804 authored by raeno's avatar raeno
Browse files

Support both OAuth token record and token string in UserView

parent 56735979
Branches
No related tags found
No related merge requests found
......@@ -86,7 +86,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
}
if assigns[:token] do
Map.put(data, "token", assigns[:token])
Map.put(data, "token", token_string(assigns[:token]))
else
data
end
......@@ -111,4 +111,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
defp image_url(%{"url" => [%{"href" => href} | _]}), do: href
defp image_url(_), do: nil
defp token_string(%Pleroma.Web.OAuth.Token{token: token_str}), do: token_str
defp token_string(token), do: token
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment