title: Nodejs :one time password generation with speakeasy package
body: <p>I've a strange problem with speakeasy OTP verifcation and the OTP should be expired after 2 minutes.</p>
  
  <p><strong>Generate token</strong></p>
  
  <pre><code>var secret = speakeasy.generateSecret({length: 20}).base32;
  
          var token = speakeasy.totp({
              secret: secret.base32,
              encoding: 'base32',
              time:120
          });
  </code></pre>
  
  <p><strong>Verify token</strong></p>
  
  <pre><code> var verified = speakeasy.totp.verify({
              secret:req.params.secret,
              encoding: 'base32',
              token: req.params.token,
              time:120
          });
  console.log(verified);
  </code></pre>
  
  <p><strong>case-1 fixed secret key</strong></p>
  
  <p>when i change <code>secret</code> key to fixed key (ie <code>secret='676FGFG!@$#'</code>) OTP is never expired  console.log(verified); always returns <code>false</code> </p>
  
  <p><strong>case-2 generate secret key with base32</strong></p>
  
  <p>when i generate <code>secret</code> using  base32 (ie <code>secret = secret.base32</code>)OTP is not verified </p>
  
  <p>console.log(verified); always returns <code>true</code> </p>