diff options
author | zeripath <art27@cantab.net> | 2021-05-31 11:46:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 11:46:20 +0100 |
commit | 7a484c0788f14412bd0531fdd021b4b292145bc5 (patch) | |
tree | 5231a76aa6a9e6eddb5a420a999fde31631a07e5 /routers | |
parent | cb940c4312981893fdb54cbd0e07520546776b34 (diff) | |
download | gitea-7a484c0788f14412bd0531fdd021b4b292145bc5.tar.gz gitea-7a484c0788f14412bd0531fdd021b4b292145bc5.zip |
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>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/setting.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 51bf68b15b..51a0e01164 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -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) |