summaryrefslogtreecommitdiffstats
path: root/routers/user/setting/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/setting/account.go')
-rw-r--r--routers/user/setting/account.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/user/setting/account.go b/routers/user/setting/account.go
index 4fb2e4be40..ca9b5b3c32 100644
--- a/routers/user/setting/account.go
+++ b/routers/user/setting/account.go
@@ -63,11 +63,10 @@ func AccountPost(ctx *context.Context, form auth.ChangePasswordForm) {
ctx.Flash.Error(errMsg)
} else {
var err error
- if ctx.User.Salt, err = models.GetUserSalt(); err != nil {
+ if err = ctx.User.SetPassword(form.Password); err != nil {
ctx.ServerError("UpdateUser", err)
return
}
- ctx.User.HashPassword(form.Password)
if err := models.UpdateUserCols(ctx.User, "salt", "passwd_hash_algo", "passwd"); err != nil {
ctx.ServerError("UpdateUser", err)
return