The Equa API uses session-based authentication powered by express-session. After a successful login, the server creates a session and returns a session cookie. This cookie must be included in all subsequent API requests.The server route examples below use the application route prefix (/v1/...). In the current browser deployment, those routes are reached through the same-origin SPA path /api/v1/....
Magic links provide passwordless email-based authentication.
The magic link module (modules/auth/src/magic-link.ts) implements token generation, verification, and session creation, but dedicated REST endpoints (POST /v1/user/magic-link and POST /v1/user/magic-link/verify) are not currently registered in auth-endpoints.ts. The implementation exists but is not yet wired to the endpoint layer.
The magic link flow (when fully wired) works as follows:Step 1: Request a magic link — Generates a 32-byte hex token (crypto.randomBytes(32).toString('hex')), stores it with a 15-minute expiry, and sends an email to the user. The response is always successful to prevent email enumeration.Step 2: Verify the magic link token — Validates the token (must be unused, not expired), marks it as used, creates a logged-in session, and returns the user object.