Skip to content

Comments

fix: update Traefik middleware when basic auth credentials change#3757

Open
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
xiaxia-unlimited:fix/update-basic-auth-middleware
Open

fix: update Traefik middleware when basic auth credentials change#3757
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
xiaxia-unlimited:fix/update-basic-auth-middleware

Conversation

@xiaxia-unlimited
Copy link

@xiaxia-unlimited xiaxia-unlimited commented Feb 19, 2026

Summary

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 #3749

Testing

  1. Create an application with basic auth
  2. Update the basic auth password
  3. Verify the Traefik middleware is updated with new credentials

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

  • This PR is safe to merge with minor inefficiency noted
  • The logic correctly handles credential updates by removing old middleware and creating new one. The implementation is straightforward and addresses the reported issue. Score is 4 instead of 5 because the code unnecessarily updates middleware even when credentials haven't actually changed (user provides same values), though this is a minor inefficiency rather than a bug.
  • No files require special attention

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!

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
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +107 to +111
if (
originalRecord &&
updatedRecord &&
(data.username !== originalRecord.username ||
data.password !== originalRecord.password)
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary middleware update when credentials unchanged - if user provides same username and password values, middleware will be removed and recreated unnecessarily

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.

Updating the basic auth account password did not update the Traefik middleware configuration.

1 participant