TwitchLib / TwitchLib.Api

API component of TwitchLib.
70 stars 84 forks source link

Twitch API doesn't throw TokenExpiredException #403

Open Nixill opened 4 months ago

Nixill commented 4 months ago

When I intentionally ran a command post-token expiry (to make sure my autorefresher works), the exception that was thrown by the invalid OAuth token was a BadScopeException, despite the fact that both TokenExpiredException and BadTokenException exist. While it wasn't logged what headers the return response came with, the response code and body was a 401 with:

{
  "error": "Unauthorized",
  "status": 401,
  "message": "Invalid OAuth token"
}
Hampo commented 4 months ago

The fix for this should probably be combined with this PR - more info good https://github.com/TwitchLib/TwitchLib.Api/pull/378