fix: update Traefik middleware when basic auth credentials change#3757
Open
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
Open
fix: update Traefik middleware when basic auth credentials change#3757xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
Conversation
When updating basic auth username or password, the Traefik middleware configuration was not being updated. This fix: 1. Gets the original record before update 2. If username or password changed, removes old middleware 3. Creates new middleware with updated credentials Fixes Dokploy#3749
Comment on lines
+107
to
+111
| if ( | ||
| originalRecord && | ||
| updatedRecord && | ||
| (data.username !== originalRecord.username || | ||
| data.password !== originalRecord.password) |
Contributor
There was a problem hiding this comment.
unnecessary middleware update when credentials unchanged - if user provides same username and password values, middleware will be removed and recreated unnecessarily
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
When updating basic auth username or password, the Traefik middleware configuration was not being updated.
This fix:
Fixes #3749
Testing
Greptile Summary
This PR fixes a bug where Traefik middleware was not being updated when basic auth credentials were changed. The fix retrieves the original record before update, then removes the old middleware and creates new middleware with updated credentials when username or password changes.
Confidence Score: 4/5
Last reviewed commit: ca0dc01
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!