def _redirect_to_target(request: fastapi.Request, default_target: str = "/") -> RedirectResponse:
    """
    Redirects the incoming request to a target URL specified in the query parameters.

    Args:
        request (fastapi.Request): The incoming HTTP request.
        default_target (str, optional): The default URL to redirect to if no target URL is specified in the query parameters. Defaults to "/".

    Returns:
        RedirectResponse: A response object that redirects the client to the target URL.
    """
    target = request.query_params.get("_target_url", default_target)
    # target = "https://huggingface.co/spaces/" + os.environ.get("SPACE_ID")
    return RedirectResponse(target)

    Redirects the incoming request to a target URL specified in the query parameters.

    Args:
        request (fastapi.Request): The incoming HTTP request.
        default_target (str, optional): The default URL to redirect to if no target URL is specified in the query parameters. Defaults to "/".

    Returns:
        RedirectResponse: A response object that redirects the client to the target URL.
    
src/autotrain/app/oauth.py