sergiodxa / remix-auth-oauth2

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

`refreshToken` type should be optional #54

Closed aaronadamsCA closed 11 months ago

aaronadamsCA commented 1 year ago

The refreshToken type is currently defined as non-optional:

https://github.com/sergiodxa/remix-auth-oauth2/blob/bd722c01aaffcfc5189b82fe8938c6b2fd219c2f/src/index.ts#L55

This doesn't match the OAuth 2.0 specification (source):

Issuing a refresh token is optional at the discretion of the authorization server.

Auth0 doesn't issue refresh tokens by default:

image

Currently if we access verifyParams.refreshToken, the types assure us of a string when in fact we will always get undefined. I think the types should be widened to reflect this.

Sorry if this has been discussed before, but I couldn't find anything!