diff options
author | 6543 <6543@obermui.de> | 2021-01-10 19:05:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-10 20:05:18 +0200 |
commit | 74a0481586b7035bbe7a82f6e7e275cdd87d382a (patch) | |
tree | 1e0a0c40619529bcc2c32ceaf007fafc0f565dfd /routers/admin/users.go | |
parent | 6b3b6f1833d07383d24d68ec220a18315ac36809 (diff) | |
download | gitea-74a0481586b7035bbe7a82f6e7e275cdd87d382a.tar.gz gitea-74a0481586b7035bbe7a82f6e7e275cdd87d382a.zip |
[Refactor] Passwort Hash/Set (#14282)
* move SaltGeneration into HashPasswort and rename it to what it does
* Migration: Where Password is Valid with Empty String delete it
* prohibit empty password hash
* let SetPassword("") unset pwd stuff
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 8a848b1f9d..9fe5c3ef7d 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -267,7 +267,10 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { ctx.ServerError("UpdateUser", err) return } - u.HashPassword(form.Password) + if err = u.SetPassword(form.Password); err != nil { + ctx.InternalServerError(err) + return + } } if len(form.UserName) != 0 && u.Name != form.UserName { |