BUGFIX: JS error when login_required is enabled