Skip to content

dont show unauthorized notification on the login page - #14054

Draft
sudo87 wants to merge 1 commit into
apache:mainfrom
shapeblue:noSessionExpireNotification
Draft

dont show unauthorized notification on the login page#14054
sudo87 wants to merge 1 commit into
apache:mainfrom
shapeblue:noSessionExpireNotification

Conversation

@sudo87

@sudo87 sudo87 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR intends to fix #11721

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sudo87 sudo87 changed the title dont show unathorized notification for prelogin dont show unauthorized notification on the login page Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.78%. Comparing base (8fb3ad4) to head (e65f83c).
⚠️ Report is 19 commits behind head on main.

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     
Flag Coverage Δ
uitests 3.53% <ø> (+0.11%) ⬆️
unittests 21.06% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sudo87

sudo87 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@sudo87 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/14054 (QA-JID-986)

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ui-login-notification.mp4

Looks good.
While it now shows the session notification once if you've a previously expired session, it doesn't show it every time like earlier

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 command for 401 responses (including parsing form-encoded POST bodies) so specific commands can bypass the global 401 flow.
  • Moves countNotify increment/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.

Comment thread ui/src/utils/request.js
Comment on lines +54 to +56
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)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants