Update lib/ueberauth/strategy/twitter.ex

Co-Authored-By: snewcomer <snewcomer@users.noreply.github.com>
This commit is contained in:
Yordis Prieto 2018-12-23 14:13:11 -08:00 committed by GitHub
parent 492e725d58
commit 237bfa718e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ defmodule Ueberauth.Strategy.Twitter do
|> put_private(:twitter_token, token) |> put_private(:twitter_token, token)
|> put_private(:twitter_user, body) |> put_private(:twitter_user, body)
{:ok, %{status_code: _, body: body, headers: _}} -> {:ok, %{status_code: _, body: body, headers: _}} ->
body = json_library().decode!(body) body = Ueberauth.Config.json_library().decode!(body)
error = List.first(body["errors"]) error = List.first(body["errors"])
set_errors!(conn, [error("token", error["message"])]) set_errors!(conn, [error("token", error["message"])])
end end