Add user.UpdateUserHash()

This commit is contained in:
Yang Luo
2021-05-08 18:51:37 +08:00
parent e3b3a76088
commit c76a432003
2 changed files with 41 additions and 0 deletions

View File

@ -45,6 +45,20 @@ func TestSyncIds(t *testing.T) {
}
}
func TestSyncHashes(t *testing.T) {
InitConfig()
users := GetGlobalUsers()
for _, user := range users {
if user.Hash != "" {
continue
}
user.UpdateUserHash()
updateUserColumn("hash", user)
}
}
func TestGetSaltedPassword(t *testing.T) {
password := "123456"
salt := "123"