AqibMukhtar/in-memory-otp

At times generates 1 digit OTP

Closed this issue · 2 comments

I think we can have a configuration to set the number of digits needed in OTP and generate based on that.

have a function like below

let OTPDigits = 4;

function getOTP() {
    let otp = '';
    for (let i = 0; i < OTPDigits; i++ ) {
        otp += Math.floor(Math.random() * 10);
    }
    return Number(otp);
}

Call this method from generateOTP

@vibindhas thank you so much for the fix. 😍

The pull request has been approved and successfully merged. Thanks again