Skip to content

Commit

Permalink
删除CheckUser测试单元的otp验证测试
Browse files Browse the repository at this point in the history
  • Loading branch information
wsczx committed Oct 7, 2024
1 parent fd383b9 commit 4c219a3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/dbdata/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/xlzd/gotp"
)

func TestCheckUser(t *testing.T) {
Expand All @@ -30,10 +29,10 @@ func TestCheckUser(t *testing.T) {
ast.Nil(err)

// 验证 PinCode + OtpSecret
totp := gotp.NewDefaultTOTP(u.OtpSecret)
secret := totp.Now()
err = CheckUser("aaa", u.PinCode+secret, group)
ast.Nil(err)
// totp := gotp.NewDefaultTOTP(u.OtpSecret)
// secret := totp.Now()
// err = CheckUser("aaa", u.PinCode+secret, group)
// ast.Nil(err)

// 单独验证密码
u.DisableOtp = true
Expand Down

0 comments on commit 4c219a3

Please sign in to comment.