E-mail user registration authentication in Node.js [closed]

0

I'm developing a user registration screen, and the need arose to authenticate the user's registration by email, the procedure would be something like, when confirming the registration an email is triggered for the user, and the same to complete the procedure would have to access your email and click on the confirmation url. Anyone have any suggestions on how to do it, or know of any examples to indicate? Thankful.

    
asked by anonymous 31.07.2017 / 22:48

2 answers

1

Your question is somewhat vague about where you are.

  • Has the database been created?
  • Can you send email?
  • I'm assuming that you have a database in the database and that you can send email. Do the following:

  • In the registered user table, create a "verified" name field of type int and assign 0 to not checked and 1 to checked. By default all entries will be 0
  • add in the register table a field named "token" of type varchar
  • Each new registration that is performed generates a unique token of type UUID
  • Send an activation link by email to your user. Example of an activation link: link
  • The above address will read query string token and will check if there is any record that matches the token. If so, change the "checked" field to 1
  • I imagine you have a login screen. At this login screen you receive the user's credentials (login and password). You should grant access only to users who have the "verified" field equal to 1.

    I hope you have helped.

        
    01.08.2017 / 01:48
    1

    Take a look at these links, which contains a step-by-step how-to.

    link

    link

        
    31.07.2017 / 23:33