Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received Less than 6-digit OTP Code #136

Closed
stanleyowen opened this issue May 6, 2021 · 1 comment
Closed

Received Less than 6-digit OTP Code #136

stanleyowen opened this issue May 6, 2021 · 1 comment
Assignees
Labels
bug Something isn't working dependencies

Comments

@stanleyowen
Copy link
Owner

stanleyowen commented May 6, 2021

Describe the bug
Although crypto.randomInt() generates secure random numbers, which meet the requirement of csprng, in some cases, crypto generates less than 6 digits integers, which may cause error in authentication.

To Reproduce
Steps to reproduce the behavior:
I didn't try to reproduce it.

Expected behavior
All operations should be done successfully and users should receive approximately 6-digit verification code.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10 OS Version 2009 (Build 19042.964)
  • Browser Chrome
  • Version 90.0.4430.93
@stanleyowen stanleyowen self-assigned this May 6, 2021
@stanleyowen stanleyowen added bug Something isn't working dependencies labels May 6, 2021
@stanleyowen stanleyowen changed the title Receiving 3 digits OTP Code Received Less than 6-digit OTP Code May 6, 2021
@stanleyowen
Copy link
Owner Author

I think I made a mistake on generating verification code, after reading the documentation and some references, I found that:
Crypto Syntax:

crypto.randomInt([min, ] max [, callback])

Parameters:
min: An optional minimum value (included) for random int to be generated. Default: 0
max: A required maximum value (excluded) for random int to be generated.
callback: An optional callback function which gets executed after a random integer is generated. If callback is specified, method works asynchronously otherwise synchronously by default.

This issue will be resolved as soon as possible. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies
Projects
None yet
Development

No branches or pull requests

1 participant