
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
mock-user-auth
Advanced tools
Mock-User-Auth is a mock user authentication API developed in Nodejs and Express using JWT as authenticator
Mock-User-Auth is a mock user authentication API developed in Nodejs and Express using JWT as an authenticator in the ES6 version of JavaScript.
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
1 - Install package:
$ npm i --save mock-user-auth
2 - Create script in package.json:
{
"script": {
"dev": "nodemon ./node_modules/mock-user-auth/bin/www.js"
}
}
3 - Start api:
$ npm run dev
Option: You can set the port after npm command:
$ npm run dev 8080
Obs.: The following instructions were tested on Ubuntu distribution.
1 - After 'git clone' command, run the following commands to install dependencies:
2 - Start application
| 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
The npm package mock-user-auth receives a total of 6 weekly downloads. As such, mock-user-auth popularity was classified as not popular.
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 is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.