2026-01-20 14:06:31 -06:00

984 B

AuthApi document shapes

This service expects JSON request bodies for its auth endpoints and stores user documents in MongoDB.

Inbound JSON documents

  • RegisterRequest (POST /api/auth/register)
    {
      "username": "string",
      "password": "string",
      "email": "string (optional)"
    }
    
  • LoginRequest (POST /api/auth/login)
    {
      "username": "string",
      "password": "string"
    }
    
  • RefreshRequest (POST /api/auth/refresh)
    {
      "username": "string",
      "refreshToken": "string"
    }
    
  • ChangeRoleRequest (POST /api/auth/role)
    {
      "username": "string",
      "newRole": "USER | SUPER"
    }
    

Stored documents (MongoDB)

  • User
    {
      "id": "string (ObjectId)",
      "username": "string",
      "passwordHash": "string",
      "role": "USER | SUPER",
      "email": "string (optional)",
      "refreshToken": "string (optional)",
      "refreshTokenExpiry": "string (optional, ISO-8601 datetime)"
    }