httpd: auto-redirect to change password page on mandatory password ch…#2194
Open
Orgenus wants to merge 1 commit intodrakkan:mainfrom
Open
httpd: auto-redirect to change password page on mandatory password ch…#2194Orgenus wants to merge 1 commit intodrakkan:mainfrom
Orgenus wants to merge 1 commit intodrakkan:mainfrom
Conversation
…ange When a user or admin is required to change their password (MustChangePassword / RequirePasswordChange), after successful login they are now immediately redirected to the change password page instead of the normal landing page. Previously, the checkAuthRequirements middleware would block every page with a Forbidden error, leaving the user with no clear path forward. - Web Client (loginUser): if user.MustChangePassword() redirect to /web/client/changepwd - Web Admin (loginAdmin): if admin.Filters.RequirePasswordChange redirect to /web/admin/changepwd The existing checkAuthRequirements middleware continues to enforce access restrictions on all other pages when the password change requirement is active.
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.
Checklist for Pull Requests
Auto-Redirect to Change Password Page on Mandatory Password Change
Summary
This PR adds a focused improvement to the WebUI login flow:
when a user or admin is required to change their password, they are now
automatically redirected to the change password page immediately after
a successful login.
Problem
When
MustChangePassword(user) orRequirePasswordChange(admin) was set,after a successful login the user was redirected to the normal landing page
(
/web/client/filesor/web/admin/users).The
checkAuthRequirementsmiddleware would then block every subsequentrequest with a Forbidden error, leaving the user with no visible path
forward and no indication of what they needed to do.
Solution
Added an explicit redirect to the change password page immediately after
login, before the normal landing page redirect.
loginUser — internal/httpd/server.go