From 74a0481586b7035bbe7a82f6e7e275cdd87d382a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 10 Jan 2021 19:05:18 +0100 Subject: [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 --- routers/api/v1/admin/user.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'routers/api') diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 93b28c2175..670baf020b 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -174,7 +174,10 @@ func EditUser(ctx *context.APIContext, form api.EditUserOption) { ctx.Error(http.StatusInternalServerError, "UpdateUser", err) return } - u.HashPassword(form.Password) + if err = u.SetPassword(form.Password); err != nil { + ctx.InternalServerError(err) + return + } } if form.MustChangePassword != nil { -- cgit v1.2.3