We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi Team,
This is code, goal is to use await.
const { authenticator } = require("@otplib/core-async"); //const authenticator = require("otplib/authenticator"); const secret = "TE2HGX3CYHA535KR3KX7Q4VLCVJFOQ5E"; (async () => { try { const token = await authenticator.generate(secret); //const isValid = otplib.authenticator.check(token, secret); // or const isValid = await authenticator.verify({ token, secret }); console.log(authenticator.timeUsed()); // or totp.timeUsed(); console.log(authenticator.timeRemaining()); // or totp.timeRemaining(); console.log(token); console.log(isValid); } catch (err) { // Error possibly thrown by the thirty-two package // 'Invalid input - it is not base32 encoded string' console.error(err); } })();
I am getting error: TypeError: Cannot read property 'generate' of undefined
tnx for your help :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi Team,
This is code, goal is to use await.
I am getting error:
TypeError: Cannot read property 'generate' of undefined
tnx for your help :)
The text was updated successfully, but these errors were encountered: