public function onFailedLogin(Event $event, $clientIp, $loginField, $loginFieldValue)
    {
        $recognitionTime = Wasabi::setting('Core.Auth.failed_login_recognition_time');
        $maxLoginAttempts = Wasabi::setting('Core.Auth.max_login_attempts');
        $past = (new \DateTime())->modify('-' . $recognitionTime . ' minutes');

        $LoginLogs = TableRegistry::get('Wasabi/Core.LoginLogs');

        $loginLog = $LoginLogs->newEntity([
            'client_ip' => $clientIp,
            'login_field' => $loginField,
            'login_field_value' => $loginFieldValue,
            'success' => false
        ]);

        $failedLogins = $LoginLogs->find()
            ->where([
                'client_ip' => $clientIp,
                'success' => false
            ])
            ->andWhere(function (QueryExpression $exp) use ($past) {
                return $exp->gt('created', $past->format('Y-m-d H:i:s'));
            })
            ->count();

        if (($failedLogins + 1) >= $maxLoginAttempts) {
            $loginLog->set('blocked', true);
        }

        $LoginLogs->save($loginLog);
    }