generateApiKey method

ApiKey generateApiKey({
  1. DateTime? expiresAt,
})

Generates an API key using a UUID v4

Implementation

ApiKey generateApiKey({DateTime? expiresAt}) {
  final key = _uuid.v4();
  final apiKey =
      ApiKey(key: key, createdAt: DateTime.now(), expiresAt: expiresAt);
  _apiKeys.add(apiKey);
  return apiKey;
}