update method
Update access_token
and expiration attributes with a BaseTokenMap inplace.
expires_at
attribute set using current epoch, avoid expiration desync
by passing only recently requested tokens Maps or updating values to compensate.
Implementation
void update(JsonMap freshAccess) {
accessToken = freshAccess['access_token'] as String;
expiresAt =
DateTime.now().millisecondsSinceEpoch ~/ 1000 +
(freshAccess['expires_in'] as int);
}