Authentication in Spades Online is session-based. After a successful login, the server creates a session in Redis and returns aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Antonelli-Tech-Solutions/spades/llms.txt
Use this file to discover all available pages before exploring further.
sessionId UUID. Every subsequent authenticated request must include this token in the x-session-id header alongside the x-player-id header. Sessions are stored in Redis with a 7-day TTL and are immediately invalidated on logout.
POST /api/auth/login
Validates the player’s credentials and, on success, creates a new session in Redis.| Method | POST |
| Path | /api/auth/login |
| Auth required | None |
Request body
The email address used to register the account. Compared case-insensitively.
The account password. Validated against the stored bcrypt hash.
Example request
Response codes
| Status | Meaning |
|---|---|
200 | Login successful. Session created. |
400 | Missing or invalid fields. |
401 | Email address not found or password is incorrect. |
403 | Credentials are valid but the account email has not been verified yet. |
200 response body
The UUID session token. Include this as the
x-session-id header on every authenticated request.The UUID of the authenticated player. Include this as the
x-player-id header on every authenticated request.The player’s display name.
The web client stores
sessionId, playerId, and username in sessionStorage immediately after a successful login. On page reload, the values are read back from sessionStorage so the player remains authenticated without logging in again.POST /api/auth/logout
Deletes the current session from Redis. ThesessionId becomes immediately invalid — any subsequent request using the old token will be rejected with 401.
| Method | POST |
| Path | /api/auth/logout |
| Auth required | x-session-id header |
Required headers
| Header | Value |
|---|---|
x-session-id | The session token UUID returned by login. |
Example request
Response codes
| Status | Meaning |
|---|---|
200 | Session invalidated. Body: { message }. |
Passing auth headers
All authenticated endpoints require bothx-session-id and x-player-id headers. The server validates the session token in Redis and verifies that the playerId in the session matches the supplied x-player-id header before processing the request.
POST /api/auth/login and should be persisted together for the duration of the session.
Rate limiting
Auth endpoints are protected by a Redis-backed fixed-window rate limiter. By default, each IP address is limited to 10 requests per 15 minutes. Exceeding the limit returns
Every rate-limited response also includes
429 Too Many Requests with a Retry-After header indicating how many seconds to wait.The limits are configurable via environment variables:| Variable | Default | Description |
|---|---|---|
AUTH_RATE_LIMIT_MAX | 10 | Maximum number of requests allowed per window per IP. |
AUTH_RATE_LIMIT_WINDOW | 900 | Rate limit window length in seconds (900 s = 15 minutes). |
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.