feat(user): add encryption algorithm and salt fields to User model for migrate

This commit is contained in:
Chang lue Tsen
2025-10-09 13:33:03 -04:00
parent de4386ff68
commit 8562734fde
14 changed files with 20 additions and 7 deletions
+1 -3
View File
@@ -40,15 +40,13 @@ func MultiPasswordVerify(algo, salt, password, hash string) bool {
case "md5":
sum := md5.Sum([]byte(password))
return hex.EncodeToString(sum[:]) == hash
case "sha256":
sum := sha256.Sum256([]byte(password))
return hex.EncodeToString(sum[:]) == hash
case "md5salt":
sum := md5.Sum([]byte(password + salt))
return hex.EncodeToString(sum[:]) == hash
case "default":
case "default": // PPanel's default algorithm
return VerifyPassWord(password, hash)
case "bcrypt":
// Bcrypt (corresponding to PHP's password_hash/password_verify)