mirror of
https://github.com/nvms/prsm.git
synced 2025-12-17 08:30:53 +00:00
9 lines
344 B
TypeScript
9 lines
344 B
TypeScript
import Otp from ".";
|
|
|
|
const totp = "355435"; // Replace with the TOTP generated by your authenticator app
|
|
// Loose validation
|
|
// const isValid = Otp.verifyTotp("IYKZRIYTTWVKXBDNG3VSY3FTQFEO3MWY", totp);
|
|
// Strict validation
|
|
const isValid = Otp.verifyTotp("IYKZRIYTTWVKXBDNG3VSY3FTQFEO3MWY", totp, 0, 0);
|
|
console.log("Is TOTP valid?", isValid);
|