## TL;DR

If you must run E2E tests, either disable refresh token rotation in the test project or mint a fresh session per test instead of reusing a global-setup token. On unexpected 401s during refresh, send the user back through sign-in instead of retrying with the same token.

## Steps

1. Treat the refresh token as single-use: after every refresh, persist the NEW refresh token from the response and discard the old one, and make sure only one writer owns that stored value (no two workers sharing one stored token). If you must run E2E tests, either disable refresh token rotation in the test project or mint a fresh session per test instead of reusing a global-setup token. On unexpected 401s during refresh, send the user back through sign-in instead of retrying with the same token.

## When to use

You are seeing this: Treat the refresh token as single-use: after every refresh, persist the NEW refresh token from the response and discard the old one, and make sure only one writer owns that stored value (no two workers sharing one stored token). Use this skill when you run into "Descope rotates refresh tokens on every use, reusing one kills the session".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
