public static function checkAuthentication($redirect = true)
    {
        if(static::isAuthenticated()) {
            return;
        }

        if ($redirect) {
            Http\Server::getInstance()->redirect(RouteCollection::getInstance()->get('login')->getUri());
        } else {
            throw new LoginException();
        }
    }