isValid method

bool isValid()

Checks to see if the session is still valid based on session expiry information found in tokens and the current time (adjusted with clock drift)

Implementation

bool isValid() {
  if (_invalidated) {
    return false;
  }
  final now = (DateTime.now().millisecondsSinceEpoch / 1000).floor();
  final adjusted = now - clockDrift!;

  return adjusted < accessToken.getExpiration() &&
      adjusted < idToken.getExpiration();
}