Skip to content

Fix session timeout check with -t tokens#4759

Open
Roadmaster wants to merge 1 commit intomasterfrom
fix-expiration-check-t-flag
Open

Fix session timeout check with -t tokens#4759
Roadmaster wants to merge 1 commit intomasterfrom
fix-expiration-check-t-flag

Conversation

@Roadmaster
Copy link
Contributor

This apparently broke on flyctl 0.3.210, probably went unnoticed since it's not a frequently used feature; user who reported it was stuck on 0.3.208.

With a freshly-generated token passed via -t:

$ fly -t "$FLY_ACCESS_TOKEN_NO_API" deploy
Welcome back!
Your session has expired, please log in to continue using flyctl.

? Would you like to sign in? No
Error: No access token available. Please login with 'flyctl auth login'

The 30-day session timeout feature has had a bumpy history:

  1. 1f90b74 — "Introducing 30-day cli session timeout" (Introducing 30-day cli session timeout #4630, Nov 5 2025) — the original version had no bypass at all, meaning even env var tokens would hit the timeout.
  2. 80affc2 — "Revert session timeout feature" (Revert session timeout feature due to test failures #4633) — reverted due to issues.
  3. 5a396de — "session timeout-improved" (session timeout-improved #4645, Nov 10 2025) — reintroduced with an env var bypass for CI/CD, but missed the -t flag. This is the commit that introduced the bug the reporting user hit.

So the -t flag was never accounted for — it was an oversight in the improved version (#4645)
when the env var bypass was added.

This code applies the env var timeout bypass for a token passed via -t as well.

This apparently broke on flyctl 0.3.210, probably went unnoticed
since it's not a frequently used feature; user who reported it
was stuck on 0.3.208.

The 30-day session timeout feature has had a bumpy history:

1. 1f90b74 — "Introducing 30-day cli session timeout" (#4630, Nov 5 2025) — the original
version had no bypass at all, meaning even env var tokens would hit the timeout.
2. 80affc2 — "Revert session timeout feature" (#4633) — reverted due to issues.
3. 5a396de — "session timeout-improved" (#4645, Nov 10 2025) — reintroduced with an env
var bypass for CI/CD, but missed the -t flag. This is the commit that introduced the bug the
reporting user hit.

So the -t flag was never accounted for — it was an oversight in the improved version (#4645)
 when the env var bypass was added.

This code applies the env var timeout bypass for a token passed via -t
as well.
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