Is there a way to increase the token expiration time of Speakeasy

Viewed 316

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
});
1 Answers

try { step: 60,//in minute(30sec defaultx2) window:5,//expiry set to 5 minute }

Related