
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
mock-user-auth
Advanced tools
Mock-User-Auth is a mock user authentication API developed in Nodejs and Express using JWT as an authenticator
Mock-User-Auth is a mock user authentication API developed in Nodejs and Express using JWT as an authenticator using the ES6 version of JavaScript. The API was tested using the Mocha & Chai libraries.
The use: It can be used to assist your front-end development. It's simple and fast, you just need to follow the steps below.
Toolkit: Node.js | Express.js | Mocha | Chai | Istanbul
Obs.: The following instructions were tested on Ubuntu distribution.
| Action | Required | Method | URL |
|---|---|---|---|
| AUTHENTICATE USER | POST | /api/v1/auth | |
| CREATE USER | POST | /api/v1/users | |
| GET USER | Auth | GET | /api/v1/users |
| PATCH USER | Auth | PATCH | /api/v1/users |
| DELETE USER | Auth | DELETE | /api/v1/users |
| DELETE ALL USERS | DELETE | /api/v1/users |
POST /api/v1/auth
{
"email": "user@gmail.com",
"password": "user123"
}
{
"token": "eyJhbGciOiJI..."
}
POST /api/v1/users
{
"name": "user",
"email": "user@gmail.com",
"password": "user123"
}
{
"message": "User registered with success",
"token": "eyJhbGciOiJI..."
}
GET /api/v1/users
const token = 'eyJhbGciOiJI...';
req.setRequestHeader('Authorization', token);
{
"id": 46643,
"name": "user",
"email": "user@gmail.com",
"password": "user123",
"imageUrl": "https://almsaeedstudio.com/themes/AdminLTE/dist/img/user2-160x160.jpg"
}
PATCH /api/v1/users
const token = 'eyJhbGciOiJI...';
req.setRequestHeader('Authorization', token);
{
"name": "newName",
"email": "new_email@gmail.com",
"password": "newpassword123"
}
{
"message": "User updated with success"
}
DELETE /api/v1/users
const token = 'eyJhbGciOiJI...';
req.setRequestHeader('Authorization', token);
{
"message": "User deleted with success"
}
DELETE /api/v1/all-users
{
"key_admin": "keyadmin123"
}
{
"message": "Users deleted with success"
}
This project is licensed under the MIT License - see the LICENSE.md file for details
Created By ThiagoLuizNunes 2019.
FAQs
Mock-User-Auth is a mock user authentication API developed in Nodejs and Express using JWT as authenticator
We found that mock-user-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.