This commit is contained in:
2026-10-25 22:47:13 +08:00
parent 897d6c4483
commit b34fba352b
20 changed files with 2615 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package auth
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestHashAndVerifyPassword(t *testing.T) {
plain := "Admin@123456"
hash, err := HashPassword(plain)
require.NoError(t, err)
require.NotEmpty(t, hash)
require.NotEqual(t, plain, hash)
require.True(t, VerifyPassword(plain, hash))
require.False(t, VerifyPassword("wrong", hash))
}