This is a workflow that contains all the controllers related to auth with NodeJS, you can use it directly in your project.
Developed with Express and MongoDB
npm install && npm start
Don't forget to add .env file that contains the following variables:
- MONGO_URI
- PORT
- JWT_SECRET
- JWT_VERIFY_SECRET
- BASE_URL (for ex "http://localhost:5000")
- EMAIL (the email you use to send email with nodemailer)
- EMAIL_PASSWORD
- Register
- Login
- Verify email (send email verification)
- Reset password (send reset password email)
- Change Password
- Maybe i'll add change user information in the future
- auth.js