1.修复谷歌验证报错
2.修复商城配置为小数点后3位
This commit is contained in:
@@ -53,13 +53,13 @@ class AdminTotp
|
||||
return self::tfa()->getQRCodeImageAsDataUri($label, $secret);
|
||||
}
|
||||
|
||||
public static function verifyCode(string $plainSecret, string $code): bool
|
||||
public static function verifyCode(string $plainSecret, string $code, int $discrepancy = 2): bool
|
||||
{
|
||||
$code = trim($code);
|
||||
if (!preg_match('/^\d{6}$/', $code)) {
|
||||
return false;
|
||||
}
|
||||
return self::tfa()->verifyCode($plainSecret, $code);
|
||||
return self::tfa()->verifyCode($plainSecret, $code, $discrepancy);
|
||||
}
|
||||
|
||||
public static function encryptSecret(string $plainSecret): string
|
||||
|
||||
Reference in New Issue
Block a user