Skip to content

fix(auth): keep refresh_token and extras across refreshes - #486

Merged
mrnasil merged 2 commits into
mainfrom
fix/auth-keep-refresh-token
Nov 25, 2026
Merged

mrnasil merged 2 commits into
mainfrom
fix/auth-keep-refresh-token

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

A refresh grant may answer without a refresh_token (Google does), and it never carries our own extras (project_id and others). ensure_fresh and force_fresh stored the refreshed token wholesale, so after the first refresh there was no refresh token left. The next expiry then forced a fresh login, roughly every hour.

carry_over copies the previous refresh_token and any missing extras onto the refreshed token before it is persisted. Fields the provider did send win.

Tests: the existing refresh tests now assert the refresh token and project_id survive, and a unit test covers what carry_over keeps and what it leaves alone.

🤖 Generated with Claude Code

A refresh grant may answer without a refresh_token (Google does) and
never carries our own extras (project_id and friends). The refreshed
token replaced the stored one wholesale, so the next expiry had nothing
to refresh with and the user had to log in again about every hour.

Carry the previous refresh_token and any extras the response left out
over to the refreshed token in both ensure_fresh and force_fresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil enabled auto-merge (squash) November 25, 2026 14:46
@mrnasil
mrnasil merged commit 696e8b3 into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/auth-keep-refresh-token branch November 25, 2026 20:37
@mrnasil mrnasil mentioned this pull request Nov 26, 2026
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.

1 participant