Cleanup models.User.HashPassword (#3334)

This commit is contained in:
Kim "BKC" Carlbäcker 2018-01-11 23:19:38 +01:00 committed by Lauris BH
parent 9aed18073d
commit e5b8b4b5ec
7 changed files with 18 additions and 23 deletions

View file

@ -229,13 +229,12 @@ func SettingsSecurityPost(ctx *context.Context, form auth.ChangePasswordForm) {
} else if form.Password != form.Retype {
ctx.Flash.Error(ctx.Tr("form.password_not_match"))
} else {
ctx.User.Passwd = form.Password
var err error
if ctx.User.Salt, err = models.GetUserSalt(); err != nil {
ctx.ServerError("UpdateUser", err)
return
}
ctx.User.HashPassword()
ctx.User.HashPassword(form.Password)
if err := models.UpdateUserCols(ctx.User, "salt", "passwd"); err != nil {
ctx.ServerError("UpdateUser", err)
return