Skip to content
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

Unable to handle :error response #57

Closed
chasers opened this issue May 18, 2020 · 1 comment
Closed

Unable to handle :error response #57

chasers opened this issue May 18, 2020 · 1 comment

Comments

@chasers
Copy link
Contributor

chasers commented May 18, 2020

Hi! Any suggestions on how to handle this? There have been a few other cases of :error responses from Github and I'm not sure how to handle.

This seems to be the issue:

{:error, %OAuth2.Error{reason: reason}} ->

#PID<0.10868.1759> running LogflareWeb.Endpoint (connection #PID<0.8105.1766>, stream id 75) terminated Server: logflare.app:80 (http) Request: GET /auth/github/callback?code=aac5e62e511dd94b2827 ** (exit) an exception was raised: ** (CaseClauseError) no case clause matching: {:error, %OAuth2.Response{body: %{"documentation_url" => "https://developer.github.com/v3", "message" => "Bad credentials"}, headers: [{"server", "GitHub.com"}, {"date", "Mon, 18 May 2020 09:16:52 GMT"}, {"content-type", "application/json; charset=utf-8"}, {"content-length", "83"}, {"status", "401 Unauthorized"}, {"x-github-media-type", "github.v3"}, {"x-ratelimit-limit", "60"}, {"x-ratelimit-remaining", "59"}, {"x-ratelimit-reset", "1589797012"}, {"access-control-expose-headers", "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset"}, {"access-control-allow-origin", "*"}, {"strict-transport-security", "max-age=31536000; includeSubdomains; preload"}, {"x-frame-options", "deny"}, {"x-content-type-options", "nosniff"}, {"x-xss-protection", "1; mode=block"}, {"referrer-policy", "origin-when-cross-origin, strict-origin-when-cross-origin"}, {"content-security-policy", "default-src 'none'"}, {"vary", "Accept-Encoding, Accept, X-Requested-With"}, {"x-github-request-id", "0411:1906:321A12:9A4723:5EC25284"}], status_code: 401}} (ueberauth_github 0.8.0) lib/ueberauth/strategy/github.ex:236: Ueberauth.Strategy.Github.fetch_user/2 (ueberauth 0.6.3) lib/ueberauth/strategy.ex:307: Ueberauth.Strategy.run_callback/2 (logflare 0.8.2) lib/logflare_web/controllers/auth/oauth_controller.ex:1: LogflareWeb.Auth.OauthController.phoenix_controller_pipeline/2 (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.call/2 (logflare 0.8.2) lib/logflare_web/endpoint.ex:1: LogflareWeb.Endpoint.plug_builder_call/2 (logflare 0.8.2) lib/logflare_web/endpoint.ex:1: LogflareWeb.Endpoint.call/2 (phoenix 1.4.17) lib/phoenix/endpoint/cowboy2_handler.ex:42: Phoenix.Endpoint.Cowboy2Handler.init/4 (cowboy 2.7.0) /logflare/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2

@Hanspagh
Copy link
Contributor

Closed by #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants