mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:10:40 +00:00
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>
This commit is contained in:
parent
9b6361f8a0
commit
1bcf1ad643
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue