Authentication

Cepress Generator supports JWT-based authentication for secure access control. You can enable or disable authentication during project setup.

Endpoints

  • POST /api/auth/register — Register new user
  • POST /api/auth/login — Login with email & password
  • GET /api/auth/profile — Get logged-in user profile

Token Handling

Upon login, users receive a JWT token. Send this token as a Bearer token in the Authorization header for protected routes.

Custom Middleware

You can add your own authentication middleware in src/middleware/auth.ts to customize validation logic or token storage.