ueberauth / ueberauth_example

Example Phoenix application using Überauth for authentication
http://ueberauth-example.herokuapp.com
MIT License
220 stars 73 forks source link

Error - no function clause matching in Poison.Encoder.Any.encode/2 #26

Closed anildigital closed 7 years ago

anildigital commented 7 years ago

Getting following error for trying Login with Slack and Uberauth? Any known issue?

[error] #PID<0.456.0> running UeberauthExample.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /auth/slack/callback?code=13091934864.128919569987.2438c05d6d&state=
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Poison.Encoder.Any.encode/2
        (ueberauth_example) lib/poison_encoder.ex:2: Poison.Encoder.Any.encode({:token, "xoxp-13091934864-116065375156-129072094709-d990cdc1e1677e9935b310a7c2d49f07"}, [])
        (poison) lib/poison/encoder.ex:232: anonymous fn/3 in Poison.Encoder.List.encode/3
        (poison) lib/poison/encoder.ex:233: Poison.Encoder.List.encode/3
        (poison) lib/poison.ex:41: Poison.encode!/2
        (oauth2) lib/oauth2/request.ex:13: OAuth2.Request.request/5
        (oauth2) lib/oauth2/access_token.ex:221: OAuth2.AccessToken.request/6
        (ueberauth_slack) lib/ueberauth/strategy/slack.ex:167: Ueberauth.Strategy.Slack.fetch_auth/2
        (ueberauth_slack) lib/ueberauth/strategy/slack.ex:65: Ueberauth.Strategy.Slack.handle_callback!/1
        (ueberauth) lib/ueberauth/strategy.ex:299: Ueberauth.Strategy.run_callback/2
        (ueberauth_example) web/controllers/auth_controller.ex:1: UeberauthExample.AuthController.phoenix_controller_pipeline/2
        (ueberauth_example) lib/ueberauth_example/endpoint.ex:1: UeberauthExample.Endpoint.instrument/4
        (ueberauth_example) lib/phoenix/router.ex:261: UeberauthExample.Router.dispatch/2
        (ueberauth_example) web/router.ex:1: UeberauthExample.Router.do_call/2
anildigital commented 7 years ago

So I had to upgrade version of ueberauth_slack to 0.4. Now this issue is fixed. Sending PR.