-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: key :body not found in: %OAuth2.Error{reason: :timeout} #193
Comments
Indeed, it looks like you're having timeouts. The function called is |
Thanks for the quick response! I'd be happy to do a PR. In this case my approach would be to pattern match and send it to #/lib/ueberauth/strategy/auth0.ex
case result do
{:ok, client} ->
token = client.token
if token.access_token == nil do
set_errors!(conn, [
error(
token.other_params["error"],
token.other_params["error_description"]
)
])
else
fetch_user(conn, client, state)
end
# Added ↓
{:error, %OAuth2.Error{reason: reason}} ->
set_errors!(conn, [error("OAuth2 error", reason)])
# Added ↑
{:error, client} ->
set_errors!(conn, [error(client.body["error"], client.body["error_description"])])
end If that approach seems reasonable to you I'll open up a PR soon. |
This approach looks good :) Happy to see a PR with this improvement ! |
Hello @achedeuzot,
On rare occasions I've gotten this error:
KeyError: key :body not found in: %OAuth2.Error{reason: :timeout}
Here's the stack trace
It looks like the code here /lib/ueberauth/strategy/auth0.ex#L154 is expecting an
%OAuth2.Response{}
, but in this case it's getting an%OAuth2.Error{}
which only has a:reason
key.The text was updated successfully, but these errors were encountered: