#2091
ENG-947: Store the renewed token from X-New-Access-Token in webapp_v2
📝 Description
The gateway renews the access token in the X-New-Access-Token response header. The CLJS app stores it; webapp_v2 did not. On React routes the session did not slide, and an expired token ended in a full redirect to /login.
Now api.js and the SSE clients store the renewed token, and every React request and SSE connect reads the token from localStorage, so a token CLJS renewed is also the one React sends.
📣 User-facing impact
Pages built in React keep the session alive like the rest of the web app, instead of sending users back to the login page when their token expires.
🔗 Related Issue
ENG-947
🚀 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
- 🎨 Style/UI update
- ♻️ Code refactor
- ⚡ Performance improvement
- ✅ Test update
- 🔧 Build configuration change
- 🧹 Chore
📋 Changes Made
useAuthStore:getToken()readslocalStorage.jwt-tokenon each call;renewToken(sent, renewed)stores a renewal only whilesentis still the current token.api.js: storesX-New-Access-Tokenfrom every response, error responses included; requests sendgetToken().liveEvents.js,serverLogs.js: sendgetToken()on each connect and store a renewal from the stream response.
🧪 Testing
Draft: QA and evidence in progress.
📸 Screenshots (if applicable)
Pending.
✅ Checklist
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- My changes generate no new warnings
- New and existing unit tests pass locally with my changes
- I have checked my code and corrected any misspellings
📄 Additional Notes
Pending.
🤖 Generated with Claude Code
Activity
2This pull request is a draft
Merging is unavailable until it is marked ready for review.
✅ Build Completed with Success, Version=2091.0.0-g28167e6