isExpired static method

bool isExpired(
  1. String token
)

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

Implementation

static bool isExpired(String token) {
  final expirationDate = getExpirationDate(token);
  // If the current date is after the expiration date, the token is already expired
  return DateTime.now().isAfter(expirationDate);
}