mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Hide mirror passwords on repo settings page (#16022)
This PR simply hides mirror passwords from being displayed on the repo settings page. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@@ -166,6 +166,12 @@ func SettingsPost(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
oldUsername := mirror_service.Username(ctx.Repo.Mirror)
|
||||
oldPassword := mirror_service.Password(ctx.Repo.Mirror)
|
||||
if form.MirrorPassword == "" && form.MirrorUsername == oldUsername {
|
||||
form.MirrorPassword = oldPassword
|
||||
}
|
||||
|
||||
address, err := forms.ParseRemoteAddr(form.MirrorAddress, form.MirrorUsername, form.MirrorPassword)
|
||||
if err == nil {
|
||||
err = migrations.IsMigrateURLAllowed(address, ctx.User)
|
||||
|
Reference in New Issue
Block a user