I am using speakeasy library to generate one time OTP https://www.npmjs.com/package/speakeasy
var token = speakeasy.totp({
secret: secret.base32,
encoding: 'base32',
step:300
});
console.log(token);
var verified = speakeasy.totp.verify({
secret: secret.base32,
encoding: 'base32',
token: token
});
console.log(verified);
But when i add the step
parameter value to 300 (expire token after 5 minutes)i will get false
on console.log(verified)
So whats the correct way to increase the token expiration time?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.