Authentication
Register
Section titled “Register”POST /api/v1/auth/registerCreate a new user account.
Request body:
{ "username": "alice", "email": "alice@example.com", "password": "securepassword"}Response 201 Created:
{ "token": "eyJhbGciOiJIUzI1NiIs...", "user": { "id": 1, "username": "alice", "email": "alice@example.com" }}POST /api/v1/auth/loginAuthenticate and receive a JWT token.
Request body:
{ "email": "alice@example.com", "password": "securepassword"}Response 200 OK:
{ "token": "eyJhbGciOiJIUzI1NiIs...", "user": { "id": 1, "username": "alice", "email": "alice@example.com" }}Passwords are hashed with Argon2id. The returned JWT token should be included in the Authorization header for all subsequent requests.