release v1.2.0

This commit is contained in:
dushixiang committed 2021-10-31 17:15:35 +08:00
1 parent 4665ab6f78
commit 6132a05786
173 files changed
+37928 -9349

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package totp
import (
otp_t "github.com/pquerna/otp"
totp_t "github.com/pquerna/otp/totp"
)
type GenerateOpts totp_t.GenerateOpts
func NewTOTP(opt GenerateOpts) (*otp_t.Key, error) {
return totp_t.Generate(totp_t.GenerateOpts(opt))
}
func Validate(code string, secret string) bool {
if secret == "" {
return true
}
return totp_t.Validate(code, secret)
}