fix: correctly decode response after log in

master
Milton Mazzarri 2017-04-17 21:55:00 -05:00
parent c451b5331c
commit 75ff1c13cf
No known key found for this signature in database
GPG Key ID: 9F4193F2B5A558FE
1 changed files with 2 additions and 1 deletions

View File

@ -286,7 +286,8 @@ defmodule Hunter.Api.HTTPClient do
%HTTPoison.Response{body: body, status_code: 200} = HTTPoison.post!(base_url <> "/oauth/token", payload, [{"Content-Type", "application/json"}])
Poison.encode!(body, as: %Hunter.Client{})
response = Poison.decode!(body)
%Hunter.Client{base_url: base_url, bearer_token: response["access_token"]}
end
## Helpers