feat(auth): add hint for missing EOO_TOKEN on 401 errors - #169
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds conditional dashboard-token guidance to upload URL authentication errors. The guidance applies to Expo-mode 401 responses. Tests cover token presence, dashboard authentication, non-401 failures, and environment cleanup. ChangesUpload authentication hint
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change improves guidance for authentication failures without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request enhances error handling and user guidance when authentication failures occur during asset upload URL requests. It adds logic to provide helpful hints to users about token requirements and includes new tests to ensure correct behavior in various authentication scenarios.
Error handling and user guidance improvements:
apps/eoas/src/lib/auth.ts: Added themissingEooTokenHintfunction, which appends a hint to error messages when a 401 Unauthorized response is received and the server expects a different authentication token (EOO_TOKEN).apps/eoas/src/lib/assets.ts: Updated therequestUploadUrlsfunction to include the hint frommissingEooTokenHintin error messages when appropriate. [1] [2]Testing enhancements:
apps/eoas/src/lib/__tests__/assets.test.ts: Added a new test suite for authentication failures, covering scenarios for missing tokens, use of the wrong token, and different HTTP status codes to ensure the hint is only provided when relevant. [1] [2]Summary by CodeRabbit