protected function createAuthLog()
    {
        $request = $this->requestStack->getCurrentRequest();

        /** @var XM\SecurityBundle\Entity\AuthLog $authLog */
        $authLog = new $this->authLogClass();
        $authLog->setDatetime(new \DateTimeImmutable());
        $authLog->setUserAgent($request->headers->get('User-Agent'));
        $authLog->setIpAddress($request->getClientIp());

        return $authLog;
    }