Was this helpful?
Returns the current user's authentication status and permissions
GET /api/auth/state HTTP/1.1 Host: localhost:3000 Authorization: Bearer JWT Accept: */*
Authentication state
{ "authenticated": true, "username": "text", "permissions": [ "text" ] }
Create a new user account
POST /api/auth/register HTTP/1.1 Host: localhost:3000 Content-Type: application/json Accept: */* Content-Length: 37 { "username": "text", "password": "text" }
User registered successfully
{ "token": "text", "permissions": [ "text" ] }
Login with username and password
POST /api/auth/login HTTP/1.1 Host: localhost:3000 Content-Type: application/json Accept: */* Content-Length: 37 { "username": "text", "password": "text" }
Login successful
Update current user's username and/or password
PUT /api/auth/profile HTTP/1.1 Host: localhost:3000 Authorization: Bearer JWT Content-Type: application/json Accept: */* Content-Length: 68 { "newUsername": "text", "currentPassword": "text", "newPassword": "text" }
Profile updated successfully
{ "message": "text", "token": "text", "permissions": [ "text" ] }