Fix login callback (#489)

This commit is contained in:
Sterling Dreyer 2025-07-15 11:21:33 -07:00 committed by GitHub
parent 3f6c7a5595
commit 32292d4b39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View file

@ -3,6 +3,7 @@ import os
PROD_CLOUD_HOST = "cloud.arcade.dev"
PROD_ENGINE_HOST = "api.arcade.dev"
LOCALHOST = "localhost"
LOCAL_AUTH_CALLBACK_PORT = 9905
# The path to the directory containing the Arcade configuration files. Typically ~/.arcade
ARCADE_CONFIG_PATH = os.path.join(os.path.expanduser(os.getenv("ARCADE_WORK_DIR", "~")), ".arcade")

View file

@ -100,7 +100,7 @@ def login(
help="The port of the Arcade Cloud host (if running locally).",
),
callback_host: str = typer.Option(
"localhost",
None,
"--callback-host",
help="The host to use to complete the auth flow - this should be the same as the host that the CLI is running on. Include the port if needed.",
),

View file

@ -32,7 +32,7 @@ from rich.text import Text
from typer.core import TyperGroup
from typer.models import Context
from arcade_cli.constants import LOCALHOST
from arcade_cli.constants import LOCAL_AUTH_CALLBACK_PORT, LOCALHOST
console = Console()
@ -188,9 +188,12 @@ def compute_login_url(
else:
callback_uri = callback_host
if not callback_uri.rstrip("/").endswith("/callback"):
callback_uri = callback_uri.rstrip("/") + "/callback"
if port:
callback_uri = callback_uri.rstrip("/") + f":{port}" + "/callback"
else:
callback_uri = callback_uri.rstrip("/") + "/callback"
else:
callback_uri = f"http://{LOCALHOST}:9905/callback"
callback_uri = f"http://{LOCALHOST}:{LOCAL_AUTH_CALLBACK_PORT}/callback"
params = urlencode({"callback_uri": callback_uri, "state": state})

View file

@ -1,6 +1,6 @@
[project]
name = "arcade-ai"
version = "2.0.5"
version = "2.0.6"
description = "Arcade.dev - Tool Calling platform for Agents"
readme = "README.md"
license = {file = "LICENSE"}