laststance / laststance/gitbox
401 interceptor races freshly-set provider token cookie
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 2
- Avg merge
- 6h 9m
- Merged PRs (30d)
- 2
Description
Summary
axios 401 interceptor unconditionally clears the GitHub provider token cookie, racing with refresh.
Source
P2 follow-up from /ship adversarial review of PR #176 (silent GitHub token refresh).
Details
src/lib/axios-github.ts:101-110 unconditionally calls deleteGitHubTokenCookie() on any 401. A stale request resolving after refresh completes can nuke the fresh cookie.
Fix
Gate deletion on the in-flight token matching the current cookie value.
Acceptance
- Stale 401 does not delete fresh cookie
- Test simulates race between stale request and refresh
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/lib/axios-github.ts:101-110, where the 401 interceptor deletes the GitHub provider token cookie. Trace the in-flight token and current cookie value, then add a test that simulates a stale request racing with refresh. Done means a stale 401 leaves the freshly set cookie intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100