spawn/shared
L 7f6d99f90f
fix: clear corrupt saved token + capture only first line of fly auth token (#1565)
Two fixes for persistent Fly.io auth failures:

1. shared/common.sh — _load_token_from_config():
   When the saved token fails the security character check, auto-delete
   the corrupt config file instead of silently returning 1. This prevents
   the user from being stuck in a loop where every run loads a malformed
   token (from a previous failed auth attempt) and immediately fails.
   Message changed from error to warn: "Saved token is malformed —
   clearing cached credentials."

2. fly/lib/common.sh — _try_flyctl_auth() and _try_fly_browser_auth():
   Pipe 'fly auth token' output through 'head -1' to capture only the
   first line. Newer flyctl versions may print warnings/metadata after
   the token on subsequent lines; previously these got concatenated into
   the token string via $() and could introduce characters that fail
   the security validator (newlines stripped by _sanitize_fly_token, but
   concatenated text from warning lines could contain unusual chars).

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-02-21 06:23:35 -08:00
..
common.sh fix: clear corrupt saved token + capture only first line of fly auth token (#1565) 2026-02-21 06:23:35 -08:00
github-auth.sh fix: persist gh auth credentials for interactive sessions (#1491) 2026-02-19 19:30:44 -05:00
key-request.sh fix: align key-request.sh token regex with shared/common.sh for FlyV1 tokens (#1562) 2026-02-21 07:15:34 -05:00