Skip to content

fix(web): recover session when tokenMeta expires before refresh token#31

Merged
Rowee13 merged 1 commit intomainfrom
fix/auth-session-recovery
Apr 15, 2026
Merged

fix(web): recover session when tokenMeta expires before refresh token#31
Rowee13 merged 1 commit intomainfrom
fix/auth-session-recovery

Conversation

@Rowee13
Copy link
Copy Markdown
Owner

@Rowee13 Rowee13 commented Apr 15, 2026

checkAuth() bailed whenever the 24h tokenMeta cookie was absent, even though the 30d refresh cookie (path=/api/auth) was still valid. Users who closed the tab for more than 24 hours saw a login screen despite having a good refresh token.

Now tries /api/auth/refresh first when tokenMeta is missing, and again on a 401 from /me, before concluding the user is logged out.

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Closes #

Changes Made

Screenshots (if applicable)

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Tested locally

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

checkAuth() bailed whenever the 24h tokenMeta cookie was absent, even
though the 30d refresh cookie (path=/api/auth) was still valid. Users
who closed the tab for more than 24 hours saw a login screen despite
having a good refresh token.

Now tries /api/auth/refresh first when tokenMeta is missing, and again
on a 401 from /me, before concluding the user is logged out.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Rowee13 Rowee13 merged commit b95cd5d into main Apr 15, 2026
5 checks passed
@Rowee13 Rowee13 deleted the fix/auth-session-recovery branch April 15, 2026 07:02
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