diff options
author | zeripath <art27@cantab.net> | 2020-09-29 21:27:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 21:27:03 +0100 |
commit | 1bcf1ad6434e45c28b9232032284299334663026 (patch) | |
tree | 2ee40e8732f76953ea6ec52d16f914a8c4d20211 /routers/admin/users.go | |
parent | 9b6361f8a09abe2ad3196132c656d1ebdfae3a27 (diff) | |
download | gitea-1bcf1ad6434e45c28b9232032284299334663026.tar.gz gitea-1bcf1ad6434e45c28b9232032284299334663026.zip |
Only set the user password if the password field would have been shown (#12980)
POSTing to /admin/users/:id should only set the password if the the user
IsLocal or IsOauth2
Fix #12952
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 531f81b8b5..9fb758621b 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -224,7 +224,7 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { } } - if len(form.Password) > 0 { + if len(form.Password) > 0 && (u.IsLocal() || u.IsOAuth2()) { var err error if len(form.Password) < setting.MinPasswordLength { ctx.Data["Err_Password"] = true |