def METHOD_NAME(request, backend, user, *args, **kwargs):
    """Complete auth process. Return authenticated user or None."""
    if request.session.get(PIPELINE_KEY):
        data = request.session.pop(PIPELINE_KEY)
        kwargs = kwargs.copy()
        if user:
            kwargs["user"] = user
        idx, xargs, xkwargs = backend.from_session_dict(data, request=request, *args, **kwargs)
        if "backend" in xkwargs and xkwargs["backend"].name == backend.AUTH_BACKEND.name:
            return backend.continue_pipeline(pipeline_index=idx, *xargs, **xkwargs)
    return backend.METHOD_NAME(user=user, request=request, *args, **kwargs)