Fix login callback (#489)
This commit is contained in:
parent
3f6c7a5595
commit
32292d4b39
4 changed files with 9 additions and 5 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
|
|
|||
Loading…
Reference in a new issue