jaredhanson/passport-twitter

Error from Twitter API should be visible

generalpiston opened this issue · 1 comments

Expected behavior

  1. Attempt to use passport-twitter with improper setup.
  2. Be provided meaningful information from the API. Usually the API provides more information.

Example information that would be nice to receive:

{
    "errors": [
        {
            "code": 453,
            "message": "You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product"
        }
    ]
}

Actual behavior

Receive the following error:

InternalOAuthError: failed to fetch user profile

Steps to reproduce

Just setup passport-twitter with out V2 API access in Twitter.

Environment

  • Node version: v18.16.0
  • passport version: passport@0.4.1
  • passport-twitter version: passport-twitter@0.1.5

Nevermind, it looks like I needed to upgrade my passport-twitter version.