forked from kevadesu/forgejo
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:
parent
cb940c4312
commit
7a484c0788
3 changed files with 12 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue