Sunday, 16 April 2017

Increase the timeout of one time OTP in node js

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 i will get false on console.log(verified)

So whats the correct way to increase the token expiration time?



via Jabaa

No comments:

Post a Comment