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

Method verifyTOTP

utils/totp.ts:100–103  ·  view source on GitHub ↗

* Verify if the input code is valid for the given secret * @param secret Base32 encoded secret key * @param inputCode The code entered by the user * @returns boolean indicating if the code is valid

(secret: string, inputCode: string)

Source from the content-addressed store, hash-verified

98 * @returns boolean indicating if the code is valid
99 */
100 public static verifyTOTP(secret: string, inputCode: string): boolean {
101 const currentTOTP = this.generateTOTP(secret)
102 return currentTOTP === inputCode
103 }
104}

Callers 1

handleVerifyFunction · 0.80

Calls 1

generateTOTPMethod · 0.95

Tested by

no test coverage detected