oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

Exposes the raw `expiresIn` value in the Credentials class

Open ncuillery opened this issue 5 years ago • 0 comments

The expiresIn received from the server is transformed into a convenient DateTime. It would be nice to expose the initial int value as well.

It would improve interoperability with other libs like Fresh.

For now I'm doing the inverse computation to convert a Credentials instance to a fresh token:

OAuth2Token(
  accessToken: credentials.accessToken,
  refreshToken: credentials.refreshToken,
  expiresIn: credentials.expiration.difference(DateTime.now()).inSeconds,
)

ncuillery avatar Aug 14 '20 13:08 ncuillery