badgateway / oauth2-client

OAuth2 client for Node and browsers
https://www.npmjs.com/package/@badgateway/oauth2-client
MIT License
269 stars 31 forks source link

Handle non-oauth2 errors better #146

Closed evert closed 1 month ago

evert commented 1 month ago

If a oauth2 server returns a HTTP error that's not in the standard oauth2 error format, this terrible error gets thrown:

  TypeError: Cannot read properties of undefined (reading 'error')
      at OAuth2Client.request (/home/evert/src/sproutfamily/app/node_modules/@badgateway/oauth2-client/dist/client.js:228:26)

Embarrassing!