laststance / laststance/gitbox

Clear refresh attempt counter on token_refresh_failed

Open
#178 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P2-medium
Dominant language
TypeScript
Stars
5
Forks
2
Avg merge
6h 9m
Merged PRs (30d)
2

Description

Summary

sessionStorage attempt counter persists after attempt > MAX_REFRESH_ATTEMPTS, breaking next session.

Source

P2 follow-up from /ship adversarial review of PR #176 (silent GitHub token refresh).

Details

When the route bails on attempt > MAX_REFRESH_ATTEMPTS, sessionStorage still reads 2; the next visit bails immediately even though it's a new session.

Fix

Either:

  • Clear sessionStorage in /login mount when error=token_refresh_failed query param is present
  • Or have the route emit a clearing Set-Cookie signal

Acceptance

  • After token_refresh_failed, the next visit retries fresh (attempt=1)
  • Test covers the recovery path

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the /login mount and the route handling token_refresh_failed; trace where the sessionStorage attempt counter is read and written. Add a recovery-path test and verify that after token_refresh_failed, the next visit retries fresh with attempt=1.

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
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.