MCPcopy Create free account
hub / github.com/027xiguapi/code-box / handleVerify

Function handleVerify

component/ui/QRCodeModal.tsx:109–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 const [isValid, setIsValid] = useState<boolean | null>(null)
108
109 const handleVerify = () => {
110 const formattedInput = inputCode.replace(/\s/g, "")
111 const secretKey = process.env.PLASMO_PUBLIC_CODEBOX_SECRET4
112
113 if (
114 formattedInput.length == 6 &&
115 TOTP.verifyTOTP(secretKey, formattedInput)
116 ) {
117 setIsValid(true)
118 onConfirm()
119 } else if (process.env.PLASMO_PUBLIC_CODEBOX_SECRET3 == formattedInput) {
120 setIsValid(true)
121 onConfirm()
122 } else {
123 setIsValid(false)
124 }
125 }
126
127 // 在原有return中添加:
128 return (

Callers

nothing calls this directly

Calls 1

verifyTOTPMethod · 0.80

Tested by

no test coverage detected