InMemoryRememberTokenStore constructor

InMemoryRememberTokenStore({
  1. DateTime clock()?,
  2. int maxEntries = 1024,
})

Creates a store with an optional clock and positive maxEntries limit.

Throws an ArgumentError when maxEntries is less than one. Expired records are pruned during reads and writes, and the oldest record is evicted when the limit is reached.

Implementation

InMemoryRememberTokenStore({
  DateTime Function()? clock,
  this.maxEntries = 1024,
}) : _clock = clock ?? DateTime.now {
  if (maxEntries < 1) {
    throw ArgumentError.value(maxEntries, 'maxEntries', 'must be positive');
  }
}