A complete Authentication system for your next NodeJS project.
- Register
- Login
- Email verification
- Forgot password
- Reset password
- Change password
- User profile
- Logout
- Clone the repo using this command
git clone https://github.com/bishalbikram/authentication-system.git
- Change directory
cd authentication-system
- Install npm packages
npm install
1. Create config folder
2. Since we are using Nodemailer and Gmail to send email, you have to configure google cloud platform
to get OAuth client ID, Client secret and Refresh token
2. Create .env file inside config directory inluding:
* PORT=3000
* MONGO_URI=mongodb://127.0.0.1:27017/authenticationsystem
* RESET_PASSWORD_URI=http://hostname:port/reset/password/
* MAIL_USERNAME=************************
* MAIL_PASSWORD=************
* OAUTH_CLIENTID=************************************************************
* CLIENT_SECRET=***********************************
* OAUTH_REFRESH_TOKEN=*******************************************************
4. Run node createKeyPair.js file from helpers directory to create Public and Private key for verifying JWT
5. Setup up a local MongoDB database
npm run dev