mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-10 00:04:14 +08:00
删除CheckUser测试单元的otp验证测试
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/xlzd/gotp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCheckUser(t *testing.T) {
|
func TestCheckUser(t *testing.T) {
|
||||||
@@ -30,10 +29,10 @@ func TestCheckUser(t *testing.T) {
|
|||||||
ast.Nil(err)
|
ast.Nil(err)
|
||||||
|
|
||||||
// 验证 PinCode + OtpSecret
|
// 验证 PinCode + OtpSecret
|
||||||
totp := gotp.NewDefaultTOTP(u.OtpSecret)
|
// totp := gotp.NewDefaultTOTP(u.OtpSecret)
|
||||||
secret := totp.Now()
|
// secret := totp.Now()
|
||||||
err = CheckUser("aaa", u.PinCode+secret, group)
|
// err = CheckUser("aaa", u.PinCode+secret, group)
|
||||||
ast.Nil(err)
|
// ast.Nil(err)
|
||||||
|
|
||||||
// 单独验证密码
|
// 单独验证密码
|
||||||
u.DisableOtp = true
|
u.DisableOtp = true
|
||||||
|
Reference in New Issue
Block a user