Currently i am using speakeasy to generate a OTP for two factor authentication.
speakeasy.totp({
secret,
encoding: 'base32'
});
I am generating the token using this. Its expiration time is 30s.
Can anyone know how to increase it?
I tried this. But it always return true when verifying the token.
speakeasy.totp({
secret,
encoding: 'base32',
time: 60,
});
speakeasy.totp.verify({
secret: secretKey,
encoding: 'base32',
token: code,
time : 60
});
The
time
option actually will not change the expiration time of the token .What you need is the
step
option to modify the expire time like this :