dont show unauthorized notification on the login page - #14054
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14054 +/- ##
============================================
+ Coverage 19.73% 19.78% +0.04%
- Complexity 19960 19994 +34
============================================
Files 6371 6371
Lines 575784 575903 +119
Branches 70478 70495 +17
============================================
+ Hits 113659 113948 +289
+ Misses 449772 449527 -245
- Partials 12353 12428 +75
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@sudo87 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
There was a problem hiding this comment.
🟡 Changes recommended
The new requestCommand extraction misses the common POST case where config.data is a URLSearchParams instance, so allowlisted commands (e.g., forgotPassword) may still trigger the 401 flow unexpectedly.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes an unwanted “Unauthorized / session expired” notification being displayed on the login page by refining the UI’s global 401-response handling in the Axios error interceptor.
Changes:
- Suppresses the generic 401 “unauthorized” notification when the current route is
/user/login. - Attempts to better detect the failed API
commandfor 401 responses (including parsing form-encoded POST bodies) so specific commands can bypass the global 401 flow. - Moves
countNotifyincrement/commit to only occur when a notification is actually shown for 401 cases.
File summaries
| File | Description |
|---|---|
| ui/src/utils/request.js | Refines global 401 handling to avoid showing the unauthorized notification on the login page and improves command detection for 401 exceptions. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const requestCommand = (response.config && response.config.params && response.config.params.command) || | ||
| (response.config && typeof response.config.data === 'string' && new URLSearchParams(response.config.data).get('command')) | ||
| if (['forgotPassword', 'listIdps', 'cloudianIsEnabled'].includes(requestCommand)) { |
Description
This PR intends to fix #11721
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?