Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Dec 31, 2025

Description

This PR fixes the login url with nested redirect parameters (url forms like http://mgmt-server/client/#/user/login?redirect=/user/login?redirect=/user/login?redirect=/). It uses the path for comparison instead of fullPath to avoid any query parameters. All the existing comparisons for the originalPath are without query parameters only.

The redirect parameters are appending here:

store.dispatch('Logout').then(() => {
if (originalPath !== '/user/login') {
router.push({ path: '/user/login', query: { redirect: originalPath } })
}
})

fullPath = /user/login?redirect=/
path = /user/login
fullPath = /user/login?redirect=/user/login?redirect=/
path == /user/login

I've not noticed this issue with latest 4.20 (even though originalPath with full path is used for comparison, as it doesn't hit the logout path as in 4.22).

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?

BEFORE CHANGES:

UILoginUrl_BeforeChanges.mov

BEFORE CHANGES (DEBUG MODE):

UILoginUrl_BeforeChanges_Debug.mov

AFTER CHANGES:

UILoginUrl_AfterChanges.mov

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where nested redirect parameters were being appended to login URLs, resulting in malformed URLs like /user/login?redirect=/user/login?redirect=/user/login?redirect=/. The fix changes the comparison in the error handler from using fullPath (which includes query parameters) to path (which only includes the path portion), preventing the redirect loop.

Key Changes:

  • Modified error handler in ui/src/utils/request.js to use router.currentRoute.value.path instead of router.currentRoute.value.fullPath for path comparison

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.59%. Comparing base (7ff76cb) to head (364485f).

Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12356      +/-   ##
============================================
- Coverage     17.59%   17.59%   -0.01%     
+ Complexity    15597    15596       -1     
============================================
  Files          5910     5910              
  Lines        529618   529618              
  Branches      64708    64708              
============================================
- Hits          93197    93178      -19     
- Misses       425930   425951      +21     
+ Partials      10491    10489       -2     
Flag Coverage Δ
uitests 3.57% <ø> (ø)
unittests 18.66% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@sureshanaparti sureshanaparti added this to the 4.22.1 milestone Dec 31, 2025
@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Contributor

tested in qa

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.

3 participants