public function getAutoLoginUrl(
        array $autoUrl,
        array $redirectUrl = null,
        string $expireInterval = '1 day',
        bool $addRememberMeCookie = true
    ): string {
        $autoUrl['?']['t'] = $this->generateLoginToken(
            $redirectUrl,
            $expireInterval,
            $addRememberMeCookie
        );
        $url = Router::url($autoUrl, true);
        $urlLength = strlen($url);
        if (strlen($url) > 2080) {
            throw new \Exception('Generated url "' . $url . '" is too long');
        }

        return $url;
    }