"Introducing our secure solution for user authentication and management! Our Node and Express MVC API offers seamless functionality for login, sign up, verification, password reset, and recovery. With our system, rest assured your users' information is safe. Say goodbye to clunky processes and hello to reliable user management. Try it now!" Secure User Authentication and Management with Node and Express MVC API This is a secure and reliable user authentication and management system built with Node and Express. It provides seamless functionality for login, sign up, verification, password reset, and recovery. With this system, you can rest assured that your users' information is safe and secure.
To get started with this system, follow these simple steps:
Clone the repository to your local machine:
git clone https://github.com/VALIANTGUARDIAN/mvc-api.git
npm install
Create a .env file and add the following variables:
PORT=[PORT NUMBER] MONGODB_URI=[MONGODB URI] JWT_SECRET=[JWT SECRET]
npm start
This system offers the following endpoints:
Sign Up
Endpoint: POST /api/auth/signup
Request Body:
{
"name": "Alpha Charlie",
"email": "[email protected]",
"password": "password123"
}
Response Body:
{
"message": "User created successfully"
}
Login
Endpoint: POST /api/auth/login
Request Body:
{
"email": "[email protected]",
"password": "password123"
}
Response Body:
{
"token": "[JWT TOKEN]"
}
Endpoint: POST /api/auth/verify/:token
Request Parameter:
token=[TOKEN]
Response Body:
{
"message": "Account verified successfully"
}
Forgot Password
Endpoint: POST /api/auth/forgot-password
Request Body:
{
"email": "[email protected]"
}
Response Body:
{
"message": "Password reset email sent successfully"
}
Reset Password
Endpoint: POST /api/auth/reset-password/:token
Request Parameter:
token=[TOKEN]
Request Body:
{ "password": "newpassword123" }
Response Body:
{
"message": "Password reset successfully"
}
This system uses JWT for authentication and bcrypt for password hashing. It also has rate limiting and CSRF protection to prevent common attacks such as brute force and cross-site request forgery.
Contributions are welcome! To contribute, fork the repository and create a pull request. Please make sure to write tests and follow the code style.