findInactiveAccounts method

  1. @override
Future<List<AuthAccountState>> findInactiveAccounts({
  1. required int inactiveDays,
  2. DateTime? now,
})
override

Looks up inactive accounts.

Implementation

@override
Future<List<AuthAccountState>> findInactiveAccounts({
  required int inactiveDays,
  DateTime? now,
}) async {
  final current = now ?? DateTime.now().toUtc();
  final cutoff = current.subtract(Duration(days: inactiveDays));
  return _states.values.where((state) {
    if (state.disabled) return false;
    if (state.lastLoginAt == null) return true;
    return state.lastLoginAt!.isBefore(cutoff);
  }).toList();
}