protected function createContainer()
    {
        $configDir = $this->pico->getConfigDir();
        $userContainer = $configDir . "PicoAuth/container.php";

        // If a user provided own container definiton, it is used
        if (is_file($userContainer) && is_readable($userContainer)) {
            $this->container = include $userContainer;
            if ($this->container === false || !($this->container instanceof \League\Container\Container)) {
                throw new \RuntimeException("The container.php does not return container instance.");
            }
        } else {
            $this->container = include $this->pluginDir . '/src/container.php';
        }

        // Additional container entries
        $this->container->share('configDir', new \League\Container\Argument\RawArgument($configDir));
        $this->container->share('PicoAuth', $this);
        if (!$this->config["rateLimit"]) {
            $this->container->share('RateLimit', \PicoAuth\Security\RateLimiting\NullRateLimit::class);
        }
    }