sergiodxa / remix-auth-oauth2

A OAuth2Strategy for Remix Auth
https://sergiodxa.github.io/remix-auth-oauth2/
MIT License
160 stars 62 forks source link

invalid token handling is incorrect #115

Closed lifeiscontent closed 2 months ago

lifeiscontent commented 2 months ago

https://github.com/sergiodxa/remix-auth-oauth2/blob/1e911b096267bd093c0b857df084d3d5b3ed9625/src/lib/token.ts#L56-L67

when I have an expired token the result looks something like this:

OAuth2RequestResult {
  body: {
    error: 'invalid_token',
    error_description: 'Token expired or revoked'
  }
}

and I get an error saying Error: Missing or invalid 'error_uri' field

cjenaro commented 2 months ago
image

I'm getting a similar issue when using X's oauth, I spent a while trying to figure out what the error was, it was getting overwritten with the error uri one