## Is your feature request related to a problem?

We manage around 20 3rd party tools that our internal users can log into using G Suite (part of your enterprise / scale offering). When a user leaves, we need to disable their account. Currently we need to do this in G Suite and then any of the 3rd party tools where password login is still possible.

## Describe the solution you'd like

When a user leaves, we disable their account in G Suite and their account in PostHog becomes disabled too. Essentially, the ability to restrict specific users in PostHog to only be able to login via SSO (defaulting to this setting).

## Describe alternatives you've considered

Manually removing their account, and being the enemy of our IT manager.

## Additional context



#### *Thank you* for your feature request – we love each and every one!

posthog/views.py
base_handler = base_login_required(view)
    @wraps(view)
    def handler(request, *args, **kwargs):
        if not User.objects.exists():
            return redirect("/preflight")
        elif not request.user.is_authenticated and settings.AUTO_LOGIN:
            user = User.objects.filter(is_active=True).first()
            login(request, user, backend="django.contrib.auth.backends.ModelBackend")
        return base_handler(request, *args, **kwargs)
    return handler
def health(request):
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
    plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
    status = 503 if plan else 200
    if status == 503:
        err = Exception("Migrations are not up to date. If this continues migrations have failed")
        sentry_sdk.capture_exception(err)
        return HttpResponse("Migrations are not up to date", status=status, content_type="text/plain")
    if status == 200:
        return HttpResponse("ok", status=status, content_type="text/plain")
def stats(request):
    stats_response: Dict[str, Union[int, str]] = {}
    stats_response["worker_heartbeat"] = get_celery_heartbeat()
    return JsonResponse(stats_response)
def robots_txt(request):
    return HttpResponse(ROBOTS_TXT_CONTENT, content_type="text/plain")
@never_cache
def preflight_check(request: HttpRequest) -> JsonResponse: