Skip to content

fix: redirect legacy /dhis-web-login/ to /login/#23855

Merged
netroms merged 2 commits into
masterfrom
fix-dhis-web-login-redirect
May 11, 2026
Merged

fix: redirect legacy /dhis-web-login/ to /login/#23855
netroms merged 2 commits into
masterfrom
fix-dhis-web-login-redirect

Conversation

@netroms

@netroms netroms commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The login app moved from /dhis-web-login/ to /login/ in #20988 (new app bundling), but bookmarked links and password-restore emails still point at the old path and now 404 in 2.43.

  • New LegacyDhisWebLoginRedirectFilter 301-redirects /dhis-web-login/**/login/**, registered before springSecurityFilterChain so unauthenticated bookmarks redirect immediately. Preserves query string and context path; ignores false-positives like /dhis-web-loginabc.
  • UserConstants.RESTORE_PATH updated to /login/index.html#/ so future password-restore emails point at the new path.

Will be backported to 2.43.

AI Assisted

The login app moved from /dhis-web-login/ to /login/ in the new
app-bundling setup (#20988), but bookmarked links and password-restore
emails still point at the old path and now 404.

- Add LegacyDhisWebLoginRedirectFilter that 301-redirects
  /dhis-web-login/** to /login/**, registered before
  springSecurityFilterChain so unauthenticated bookmarks redirect
  immediately. Preserves query string and context path; ignores
  false-positives like /dhis-web-loginabc.
- Update UserConstants.RESTORE_PATH so password-restore emails point at
  the new path going forward.

AI Assisted
.addFilter(
"LegacyDhisWebLoginRedirectFilter",
new DelegatingFilterProxy("legacyDhisWebLoginRedirectFilter"))
.addMappingForUrlPatterns(null, false, "/*");

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.

Will this filter on every request because of /*?
Should this only filter on some variation of /dhis-web-login?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Improved it now.

Avoid invoking the filter on every request — let the servlet container
route only matching paths to it.
@sonarqubecloud

Copy link
Copy Markdown

@netroms
netroms requested a review from david-mackessy May 11, 2026 13:34
@netroms
netroms merged commit 1450d93 into master May 11, 2026
18 checks passed
@netroms
netroms deleted the fix-dhis-web-login-redirect branch May 11, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants