Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. sabubalakrishnan
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Groups 0

    sabubalakrishnan

    @sabubalakrishnan

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sabubalakrishnan Unfollow Follow

    Latest posts made by sabubalakrishnan

    • RE: Invalid totp

      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

      posted in Bugs
      S
      sabubalakrishnan