public function throttle(int $maxLoginAttempts, int $lockTime, bool $autoSave = true): bool
	{
		$now = Time::now();

		// Reset the failed attempt count if the last failed attempt was more than $lockTime seconds ago

		if($this->last_fail_at !== null)
		{
			if(($now->getTimestamp() - $this->last_fail_at->getTimestamp()) > $lockTime)
			{
				$this->failed_attempts = 0;
			}
		}

		// Increment the failed attempt count and update the last fail time

		$this->failed_attempts++;

		$this->last_fail_at = $now;

		// Lock the account for $lockTime seconds if we have exeeded the maximum number of login attempts

		if($this->failed_attempts >= $maxLoginAttempts)
		{
			$this->locked_until = (clone $now)->forward($lockTime);
		}

		// Save the changes to the user if autosave is enabled

		return $autoSave ? $this->save() : true;
	}