oauth2
oauth2 copied to clipboard
Exposes the raw `expiresIn` value in the Credentials class
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,
)