- Sessions and Cookies
- HTTPS (self signing)
- Sending emails (mailing lists and unsubscribe), the law (nodemailer).
- Account verification
- Password reset
Authentication vs Authorisation (have ordinary and admin users).
Message board that sends daily digests. Include an unsubscribe link.
https://stackoverflow.com/questions/39092822/how-to-do-confirm-email-address-with-express-node
- Your User model should have an active attribute that is false by default
- When the user submits a valid signup form, create a new User (who's active will be false initially)
- Create a random hash and store it in your database with a reference to the User ID
- Send an email to the supplied email address with the hash as part of a link pointing back to a route on your server
- When a user clicks the link and hits your route, check for the hash passed in the URL
- If the hash exists in the database, get the related user and set their active property to true
Delete the hash from the database, it is no longer needed.
http://sahatyalkabov.com/how-to-implement-password-reset-in-nodejs/