fix(auth): include --access-token flag in session-timeout bypass#4864
Open
fix(auth): include --access-token flag in session-timeout bypass#4864
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4648.
PR #4645 added a 30-day re-login prompt with a CI bypass for
FLY_ACCESS_TOKEN/FLY_API_TOKENenv 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.