Kaleron
API Reference

Account Service API

Reference for the Kaleron authentication & account-linking endpoints.

Base URL · https://auth.kaleron.org/

Authentication

/api/auth

Registration, login, and session management. Sessions are carried by a token cookie (HttpOnly, SameSite=Lax, 48-week lifetime).

POST /api/auth/register

Creates a new account and signs the user in immediately.

Body: JSON Sets: token cookie

Query parameters

NameTypeRequiredDescription
nextstringoptional URL to redirect to after registration. Defaults to the login page.

Request body

FieldTypeRequiredDescription
emailstringrequiredAccount email address.
usernamestringrequiredUnique username.
passwordstringrequiredPlaintext password (hashed with Argon2 server-side).

Example request

POST /api/auth/register
Content-Type: application/json

{
  "email": "[email protected]",
  "username": "your_handle",
  "password": "••••••••"
}

Responses

302 → next / login 200 MISSING_PARAMETERS 200 ACCOUNT_ALR_EXIST

Note: error cases currently return HTTP 200 with a message field rather than a 4xx status.

GET /api/auth/login

Renders the sign-in / sign-up page.

Returns: HTML

Responses

200 auth.html
POST /api/auth/login

Authenticates a user by email or username and issues a session cookie.

Body: JSON Sets: token cookie

Query parameters

NameTypeRequiredDescription
nextstringoptionalRedirect target after successful login.

Request body

FieldTypeRequiredDescription
input1stringrequiredEmail address or username.
passwordstringrequiredAccount password.

Example request

POST /api/auth/login
Content-Type: application/json

{
  "input1": "[email protected]",
  "password": "••••••••"
}

Responses

302 → next / login 200 MISSING_PARAMETERS 200 INVALID_CREDENTIALS
GET /api/auth/logout

Clears the session cookie and redirects to the login page.

Clears: token cookie

Responses

302 → /api/auth/login

Service

/api/accounts

Convenience endpoints exposed by the website backend that proxy the Kaleron account service on behalf of the currently signed-in user.