fix: redirect legacy /dhis-web-login/ to /login/#23855
Merged
Merged
Conversation
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
vietnguyen
approved these changes
May 8, 2026
| .addFilter( | ||
| "LegacyDhisWebLoginRedirectFilter", | ||
| new DelegatingFilterProxy("legacyDhisWebLoginRedirectFilter")) | ||
| .addMappingForUrlPatterns(null, false, "/*"); |
Contributor
There was a problem hiding this comment.
Will this filter on every request because of /*?
Should this only filter on some variation of /dhis-web-login?
Contributor
Author
There was a problem hiding this comment.
Good catch! Improved it now.
Avoid invoking the filter on every request — let the servlet container route only matching paths to it.
|
david-mackessy
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.LegacyDhisWebLoginRedirectFilter301-redirects/dhis-web-login/**→/login/**, registered beforespringSecurityFilterChainso unauthenticated bookmarks redirect immediately. Preserves query string and context path; ignores false-positives like/dhis-web-loginabc.UserConstants.RESTORE_PATHupdated to/login/index.html#/so future password-restore emails point at the new path.Will be backported to 2.43.
AI Assisted