projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5673597
)
Support both OAuth token record and token string in UserView
author
raeno
<just.raeno@gmail.com>
Mon, 17 Dec 2018 15:02:26 +0000
(16:02 +0100)
committer
raeno
<just.raeno@gmail.com>
Mon, 17 Dec 2018 15:02:26 +0000
(16:02 +0100)
lib/pleroma/web/twitter_api/views/user_view.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/twitter_api/views/user_view.ex
b/lib/pleroma/web/twitter_api/views/user_view.ex
index b3459af9af7768cc2316b1f122f75fecfeee193f..8a88d72b1bf07ed2d006bc1d7730b7566c66a4c0 100644
(file)
--- a/
lib/pleroma/web/twitter_api/views/user_view.ex
+++ b/
lib/pleroma/web/twitter_api/views/user_view.ex
@@
-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