summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-01-10 19:05:18 +0100
committerGitHub <noreply@github.com>2021-01-10 20:05:18 +0200
commit74a0481586b7035bbe7a82f6e7e275cdd87d382a (patch)
tree1e0a0c40619529bcc2c32ceaf007fafc0f565dfd /cmd
parent6b3b6f1833d07383d24d68ec220a18315ac36809 (diff)
downloadgitea-74a0481586b7035bbe7a82f6e7e275cdd87d382a.tar.gz
gitea-74a0481586b7035bbe7a82f6e7e275cdd87d382a.zip
[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
Diffstat (limited to 'cmd')
-rw-r--r--cmd/admin.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index b4e0c3cb5e..3ddf8eddf9 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -349,12 +349,11 @@ func runChangePassword(c *cli.Context) error {
if err != nil {
return err
}
- if user.Salt, err = models.GetUserSalt(); err != nil {
+ if err = user.SetPassword(c.String("password")); err != nil {
return err
}
- user.HashPassword(c.String("password"))
- if err := models.UpdateUserCols(user, "passwd", "passwd_hash_algo", "salt"); err != nil {
+ if err = models.UpdateUserCols(user, "passwd", "passwd_hash_algo", "salt"); err != nil {
return err
}