Skip to content

fix(auth): include --access-token flag in session-timeout bypass#4864

Open
Lucais11 wants to merge 1 commit intomasterfrom
fix/access-token-flag-bypass
Open

fix(auth): include --access-token flag in session-timeout bypass#4864
Lucais11 wants to merge 1 commit intomasterfrom
fix/access-token-flag-bypass

Conversation

@Lucais11
Copy link
Copy Markdown
Contributor

@Lucais11 Lucais11 commented Apr 27, 2026

Fixes #4648.

PR #4645 added a 30-day re-login prompt with a CI bypass for FLY_ACCESS_TOKEN / FLY_API_TOKEN env vars but missed the --access-token (-t) persistent flag. The result: long-documented CI patterns like flyctl proxy --app $APP --access-token $TOKEN started failing with "no auth token" in v0.3.210 even when a valid token was supplied.

Extracts the bypass condition into a small hasExternallySuppliedToken helper and adds the flag to it. Token precedence is unchanged, applyFlags already populates cfg.Tokens from the flag during the LoadConfig preparer, before RequireSession runs. The bypass change just stops the re-login prompt from firing for an auth path that's already authenticated.

Adds a focused unit test for the helper covering env-only, flag-only, and neither-set cases.

PR #4645 added a 30-day re-login prompt with a CI bypass for env-var tokens, but missed the --access-token flag. So in CI, `flyctl --access-token $TOKEN ...` started failing with "no auth token" even when the token was right there.

Extends the bypass to cover the flag too. Adds a small unit test for the bypass conditions.

Fixes #4648
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.

0.3.210 regression with --access-token

1 participant