diff options
Diffstat (limited to 'routers/user/setting.go')
-rw-r--r-- | routers/user/setting.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go index 10e8fd02..35bff326 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -189,7 +189,11 @@ func SettingsPasswordPost(ctx *context.Context, form auth.ChangePasswordForm) { ctx.Flash.Error(ctx.Tr("form.password_not_match")) } else { ctx.User.Passwd = form.Password - ctx.User.Salt = models.GetUserSalt() + var err error + if ctx.User.Salt, err = models.GetUserSalt(); err != nil { + ctx.Handle(500, "UpdateUser", err) + return + } ctx.User.EncodePasswd() if err := models.UpdateUser(ctx.User); err != nil { ctx.Handle(500, "UpdateUser", err) |