diff options
author | Morgan Bazalgette <git@howl.moe> | 2018-01-08 23:28:18 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-01-08 23:28:18 +0100 |
commit | 674cfb7cacd99bb236b13db8754b21ae2f555ca8 (patch) | |
tree | 61ada7cd00322873dc508f5d7b90023415a37b35 /routers | |
parent | f2b841d0ec129f8718a64f2f410484c3acf61368 (diff) | |
download | gitea-674cfb7cacd99bb236b13db8754b21ae2f555ca8.tar.gz gitea-674cfb7cacd99bb236b13db8754b21ae2f555ca8.zip |
Change EncodePasswd to HashPassword (#3329)
* Change EncodePasswd to HashPassword
* Create test+benchmark for HashPassword
Diffstat (limited to 'routers')
-rw-r--r-- | routers/admin/users.go | 2 | ||||
-rw-r--r-- | routers/api/v1/admin/user.go | 2 | ||||
-rw-r--r-- | routers/user/auth.go | 2 | ||||
-rw-r--r-- | routers/user/setting.go | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 1081f3092f..02b8334564 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -200,7 +200,7 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { ctx.Handle(500, "UpdateUser", err) return } - u.EncodePasswd() + u.HashPassword() } u.LoginName = form.LoginName diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index fc1d3da2f1..5bbb8a7afd 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -132,7 +132,7 @@ func EditUser(ctx *context.APIContext, form api.EditUserOption) { ctx.Error(500, "UpdateUser", err) return } - u.EncodePasswd() + u.HashPassword() } u.LoginName = form.LoginName diff --git a/routers/user/auth.go b/routers/user/auth.go index c353db8984..f7fb1512a1 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -994,7 +994,7 @@ func ResetPasswdPost(ctx *context.Context) { ctx.Handle(500, "UpdateUser", err) return } - u.EncodePasswd() + u.HashPassword() if err := models.UpdateUserCols(u, "passwd", "rands", "salt"); err != nil { ctx.Handle(500, "UpdateUser", err) return diff --git a/routers/user/setting.go b/routers/user/setting.go index a2f32e3e19..d83c62d89d 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -235,7 +235,7 @@ func SettingsSecurityPost(ctx *context.Context, form auth.ChangePasswordForm) { ctx.Handle(500, "UpdateUser", err) return } - ctx.User.EncodePasswd() + ctx.User.HashPassword() if err := models.UpdateUserCols(ctx.User, "salt", "passwd"); err != nil { ctx.Handle(500, "UpdateUser", err) return |