[Customer Portal] Fix unauthorized access response status - #78
Conversation
📝 WalkthroughWalkthroughThe GET users/me endpoint's error response handling is updated to return http:Unauthorized instead of http:Forbidden when user details retrieval fails, with corresponding log messages and error body text modified to reflect this change. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Pull request overview
Updates the Customer Portal /users/me endpoint to respond with 401 Unauthorized (instead of 403 Forbidden) for unauthorized access attempts, aligning behavior with the expected HTTP status semantics described in Issue #79.
Changes:
- Updated
/users/meresource return type to includehttp:Unauthorizedinstead ofhttp:Forbidden. - Updated the status-code mapping logic and the returned error message for unauthorized access.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ba76bc1
into
wso2-open-operations:customer-portal-milestone-1
Description
This PR updates the access validation logic to return 401 Unauthorized instead of 403 Forbidden when a user is not authorized to access the Customer Portal.
Previously, unauthorized access attempts were incorrectly handled as forbidden responses.
Changes
401 Unauthorizedfor unauthorized users.Impact
Related Issues
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.