Simple JWT Authorization template made with ExpressJs and MongoDB.
Example on how to implement user authorization, with user information encrypted and stored in a MongoDB type database.
This repo requires the following to run:
- DATABASE: Your mongoDB path.
- JWT_TOKEN: Your JWT secret.
POST /api/register
Body | Type | Description |
---|---|---|
username |
string |
Required. Username |
password |
string |
Required. Password |
POST /api/login
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username |
password |
string |
Required. Password |
POST /api/change_password
Parameter | Type | Description |
---|---|---|
newPassword |
string |
Required. New Password |
token |
string |
Required. JWT Token |