Skip to content

fix(login): validate the token on the runtime's API port, not always 3333 - #1490

Merged
Pijukatel merged 1 commit into
actor-runtimefrom
fix/login-runtime-api-port
Oct 12, 2026
Merged

Pijukatel merged 1 commit into
actor-runtimefrom
fix/login-runtime-api-port

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

  • apify login with a local Console URL always validated the token against http://localhost:3333, so a runtime started on another port (apify runtime start --api-port 4333, or ACTOR_RUNTIME_API_PORT from feat: Make the API and console ports configurable actor-runtime#80) was unreachable from login.
  • Login now picks the API in this order: APIFY_CLIENT_BASE_URL or the connected runtime, then the port the runtime was last started on, then 3333 when no port is known (hand-started runtime on the defaults, local platform development).
  • Adds resolveLoginApiBaseUrl() with unit tests for each of those cases.

Verified

  • Against a real apify/actor-runtime:latest started with --api-port 4333 --console-port 4000: login succeeds while connected, and with only APIFY_CONSOLE_URL=http://localhost:4000 set, with nothing listening on 3333.
  • Lint, format, build, and test:local (the only failures are the pre-existing root-user "cannot write" cases).

…3333

With a local Console URL, `apify login` always validated the token against
http://localhost:3333. A runtime started on another port (`apify runtime
start --api-port 4333`, `ACTOR_RUNTIME_API_PORT` in the container) was
therefore never reachable from login.

Login now takes the API from `APIFY_CLIENT_BASE_URL` or the connected
runtime first, then the port the runtime was last started on, and only
falls back to 3333 when no port is known (hand-started runtime on the
defaults, local platform development).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JzfLYa5CHCXxfzC1No3gV
@Pijukatel
Pijukatel merged commit 8f318d0 into actor-runtime Oct 12, 2026
17 of 20 checks passed
@Pijukatel
Pijukatel deleted the fix/login-runtime-api-port branch October 12, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants