def METHOD_NAME(request, backend, *args, **kwargs):
    """Authentication complete view"""
    if isinstance(request.backend, MultiTenantMixin):
        # Get tenant name from session storage
        saved_tenant = request.backend.strategy.session_get("tenant")
        if saved_tenant is None:
            log.error('Session contains no value for "tenant".')
            return redirect("accounts:login")
        try:
            # Setting the tenant on the backend performs normalization and validation of tenant
            # Part of the validation is that the provided tenant is in the MULTI_TENANT setting.
            request.backend.tenant = saved_tenant
        except (ImproperlyConfigured, ValueError) as e:
            log.error(str(e))
            return redirect("accounts:login")
    return do_complete(
        request.backend,
        _do_login,
        *args,
        user=request.user,
        redirect_name=REDIRECT_FIELD_NAME,
        request=request,
        **kwargs,
    )