validateApiKey method

bool validateApiKey(
  1. String key
)

Validates an API key

Implementation

bool validateApiKey(String key) {
  return _apiKeys.any((apiKey) =>
      apiKey.key == key &&
      (apiKey.expiresAt == null ||
          apiKey.expiresAt!.isAfter(DateTime.now())));
}