Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. hemil.quarec
    3. Topics
    H
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by hemil.quarec

    • H

      Invalid totp
      General Discussion • • hemil.quarec  

      2
      0
      Votes
      2
      Posts
      11
      Views

      A

      @hemil-quarec TOTP is working fine.
    • H

      Invalid totp
      Bugs • • hemil.quarec  

      3
      0
      Votes
      3
      Posts
      10
      Views

      S

      const otplib = require('otplib'); // The secret from your otpauth URL const secret = 'XXXXXXXXX'; // Set up the algorithm and other options globally otplib.authenticator.options = { algorithm: 'sha1', // Use SHA1 algorithm digits: 6, // Number of digits in the OTP step: 30 // Period in seconds (default is 30 seconds) }; /** Function to generate a TOTP based on a provided secret. @param {string} secret - The shared secret key. @returns {string} - The generated OTP. */ function generateTOTP() { return otplib.authenticator.generate(secret); } module.exports = { generateTOTP }; I am using this code to generate TOTP some sometimes getting validate TOTP and sometime not getting it verified