Fix token refresh not triggering on 403 responses#74
Conversation
The token refresh handler only intercepted 401 responses, but an expired JWT can cause the PHP backend to return 403 when the invalid token resets the authenticated user to 0 and the capability check fails. Now intercepts both 401 and 403 to trigger token refresh.
📝 WalkthroughWalkthroughThe token refresh handler now treats HTTP 403 Forbidden errors the same as 401 Unauthorized errors, enabling token refresh attempts when expired JWTs affect capability checks. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
📊 Test Coverage Report
Coverage Legend
|
🚀 Deployment Summary
🔗 Quick Links❌ Failed Tests (4 total)settings.spec.ts
📋 Full error details (first 5)settings.spec.ts - should change language to French and load translations from CDNProject: settings.spec.ts - should persist language after closing and reopening settingsProject: settings.spec.ts - should change language to French and load translations from CDNProject: settings.spec.ts - should persist language after closing and reopening settingsProject: 📸 Failure Screenshots🔗 Debug Links
🤖 Updated by GitHub Actions |






Summary
Context
Companion fix on the PHP side: wcpos/woocommerce-pos#472
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit