isExpired static method

bool isExpired(
  1. String token
)

Returns false if the token is valid, true if it is expired.

Implementation

static bool isExpired(String token) {
  final expirationDate = getExpirationDate(token);
  if (expirationDate == null) {
    return false;
  }

  return DateTime.now().isAfter(expirationDate);
}