SohoHouse / nuxt-oauth

Simple OAuth2 integration for your Nuxt app
MIT License
122 stars 27 forks source link

Fix for dates bug in oauth-client2 #101

Closed davehwly closed 1 year ago

davehwly commented 1 year ago

Why?

Fixes a bug where a refresh will never occur as the expires token is stored incorrectly.

oauth-client2 createSession uses a parameter for data.expires_in which is meant to handle both absolute expiry dates as well as a relative expire duration for tokens. Currently passing a date into expires_in results in an "Invalid Date" and therefore a token without an expiry is persisted.

Issue is still detailed here but currently not fixed https://github.com/mulesoft-labs/js-client-oauth2/issues/106

How to test:

  1. create oauth session
  2. persist token from client-oauth2
  3. rehydrate token and pass absolute date into data.expires_in

Expected Result: token correctly created with date