Skip to content

fix(sdk): the browser session keeps its refresh token when a refresh returns none - #633

Merged
PiquelChips merged 1 commit into
mainfrom
fix/627-browser-keeps-refresh-token
Nov 21, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
fix/627-browser-keeps-refresh-token

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

A browser Session lost its refresh token after any refresh whose response carried no refresh_token. RFC 6749 §6 allows that, so once the next access token expired, accessToken() threw invalid_token (expired) instead of refreshing again.

The session now keeps the refresh token it redeemed when the response carries none. The server-side Login and the Rust SDK already work this way. The new test in browser.test.ts follows the issue's reproduction, and it fails without the fix (AuthError: the access token expired).

No docs change: the browser apps guide already says the session refreshes when the sign-in brought a refresh token. The published type declarations don't change either, since only a private method changed.

Closes #627

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

…returns none

A refresh whose response carried no refresh_token replaced the session's
tokens and dropped the one it had, so the next expiry threw invalid_token
instead of refreshing. RFC 6749 §6 lets a server keep the refresh token
unchanged; the session now keeps it, as the server-side Login and the Rust
SDK do.

Closes #627
@PiquelChips
PiquelChips marked this pull request as draft November 20, 2026 09:55
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 20, 2026
@PiquelChips PiquelChips added bug Something isn't working sdk Rust and TypeScript SDKs labels Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 604474eb-3f64-40d0-95cc-0cec6d43f418
Commits

Reviewing files that changed from the base of the PR and between 467e813 and 939273f.

Files selected for processing: 2

  • packages/auth/src/browser.ts
  • packages/auth/test/browser.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips marked this pull request as ready for review November 20, 2026 10:07
@PiquelChips
PiquelChips marked this pull request as draft November 21, 2026 14:01
@PiquelChips
PiquelChips marked this pull request as ready for review November 21, 2026 14:22
@PiquelChips
PiquelChips added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit c9401fd Nov 21, 2026
13 checks passed
@PiquelChips
PiquelChips deleted the fix/627-browser-keeps-refresh-token branch November 21, 2026 16:07
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in sourceorigin.dev Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sdk Rust and TypeScript SDKs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(sdk): the browser session keeps its refresh token when a refresh returns none

1 participant