I am a beginner and I cannot find a tutorial on the Internet to send a 5-digit code (for example) by email to a user who has just registered or wants to reset his password.
I am using a Rest API under Node.js and a React.js frontend. So you have to register the user and send him an email containing a code and when the user will try to connect without his account being indicated as "active" in the database, we will ask him for a 5-digit code.
I can not find any tutorials on this practice to know how to do it the right way without security vulnerabilities.
Thank you for your understanding !
If you are using Node.js above v12.19.0: