recordLogin method

  1. @override
Future<AuthAccountState> recordLogin(
  1. String userId, {
  2. DateTime? now,
})
override

Records login.

Implementation

@override
Future<AuthAccountState> recordLogin(String userId, {DateTime? now}) async {
  final current = now ?? DateTime.now().toUtc();
  final existing =
      _states[userId.trim()] ?? AuthAccountState(userId: userId.trim());
  final updated = existing.copyWith(
    lastLoginAt: current,
    failedLoginAttempts: 0,
    clearLockedUntil: true,
  );
  _states[userId.trim()] = updated;
  return updated;
}