API Status: Offline
Documentation

Mock Authentication System

When you enable the Mock Auth toggle in your project settings, Rest Faker automatically provides a complete authentication system with signup, signin, and profile management endpoints.

What You Get

User Registration

Sign up new users with email validation

Secure Login

JWT-based authentication system

Profile Management

View user profiles

Authentication Endpoints

User Registration

POST /api/schema/signup

Register a new user account. Automatically generates a JWT token upon successful registration.

Request Body:
firstName: string (required)
lastName: string (required)
email: string (required)
password: string (required)
Example Request:
javascript
// Sign up a new user
fetch('https://api.restfaker.dev/api/schema/signup', {
  method: 'POST',
  headers: {
    'apiToken': 'your_api_token_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'securePassword123',
    firstName: 'John',
    lastName: 'Doe'
  })
})
.then(response => response.json())
.then(data => console.log(data));
Response:
json
{
  "success": true,
  "message": "User created successfully",
  "data": {
    "id": "uuid-string",
    "email": "user@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "projectId": "uuid-string",
    "createdAt": "2025-01-15T10:30:00Z",
    "updatedAt": "2025-01-15T10:30:00Z",
  }
}

User Login

POST /api/schema/signin

Authenticate an existing user and receive a JWT token for accessing protected routes.

Request Body:
email: string (required)
password: string (required)
Example Request:
javascript
// Sign in an existing user
fetch('https://api.restfaker.dev/api/schema/signin', {
  method: 'POST',
  headers: {
    'apiToken': 'your_api_token_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'securePassword123'
  })
})
.then(response => response.json())
.then(data => {
  // Store the auth token for future requests
  const authToken = data.token;
  console.log(data);
});
Response:
json
{
  "success": true,
  "message": "Login successful",
  "token": "jwt-token-string"
}

Profile Management

GET /api/schema/profile

View user profile information. Requires authentication token in the Authorization header.

Get Profile:
javascript
// Get user profile (requires auth token)
fetch('https://api.restfaker.dev/api/schema/profile', {
  headers: {
    'apiToken': 'your_api_token_here',
    'Authorization': 'Bearer jwt-token-here',
    'Content-Type': 'application/json'
  }
})
.then(response => response.json())
.then(data => console.log(data));
Profile Response:
json
{
  "success": true,
  "data": {
    "id": "uuid-string",
    "email": "user@example.com",
    "projectId": "uuid-string",
    "firstName": "John",
    "lastName": "Doe",
    "createdAt": "2025-01-15T10:30:00Z",
    "updatedAt": "2025-01-15T10:30:00Z",
  }
}

Important Notes

This is a mock authentication system designed for development and testing purposes only.
User data is generated with fake information and may be reset periodically.
JWT tokens are valid for testing but should not be used in production applications.
All auth endpoints require your project's API token in addition to user authentication.

Getting Started with Mock Auth

1

Enable Mock Auth

Toggle the "Mock Auth" switch in your project settings to activate the authentication system.

2

Test User Registration

Use the signup endpoint to create test users with fake email addresses.

3

Implement Frontend Auth

Store JWT tokens and include them in headers for protected API calls.