From 43ec1fff9da314eacee742acd3ad1e69a79f007b Mon Sep 17 00:00:00 2001 From: Nova Date: Tue, 9 Jun 2026 10:29:30 +0000 Subject: [PATCH] fix: handle slow_down in GitHub device-flow token polling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per RFC 8628 ยง3.5, slow_down is not a terminal error. The client must increase its polling interval by 5 seconds and continue. Previously, slow_down was treated as a fatal error, causing login to fail with "token request failed: slow_down" and forcing the user to restart. This commit treats slow_down the same as authorization_pending but with the required interval increase. --- cmd/publisher/auth/github-at.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/publisher/auth/github-at.go b/cmd/publisher/auth/github-at.go index 3e53529e1..9ba6b99d1 100644 --- a/cmd/publisher/auth/github-at.go +++ b/cmd/publisher/auth/github-at.go @@ -229,8 +229,10 @@ func (g *GitHubATProvider) pollForToken(ctx context.Context, deviceCode string) return "", err } - if tokenResp.Error == "authorization_pending" { - // User hasn't authorized yet, wait and retry + if tokenResp.Error == "authorization_pending" || tokenResp.Error == "slow_down" { + if tokenResp.Error == "slow_down" { + interval += 5 + } time.Sleep(time.Duration(interval) * time.Second) continue }