support ipv6

This commit is contained in:
TenderIronh
2022-05-15 13:08:56 +08:00
parent b2d35c6f97
commit 532d3667ce
13 changed files with 131 additions and 78 deletions
+3
View File
@@ -25,6 +25,9 @@ func VerifyTOTP(code uint64, token uint64, ts int64) bool {
if code == 0 {
return false
}
if code == token {
return true
}
if code == GenTOTP(token, ts) || code == GenTOTP(token, ts-TOTPStep) || code == GenTOTP(token, ts+TOTPStep) {
return true
}