Auth Service implements a classic email-and-password credential flow in four stages: a user registers an account, confirms their email address via a single-use token, logs in with their verified credentials, and then uses the issued JWT access token to access protected resources. Every step is designed with a security-first posture — enumeration of existing accounts is deliberately prevented at the registration and verification-resend endpoints, and a single, indistinguishable error is returned for all credential failures at login.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/auth-service/llms.txt
Use this file to discover all available pages before exploring further.
Full authentication flow
Register an account
Submit the user’s email and password. Auth Service creates the account in Response — 202 Accepted
PENDING_VERIFICATION state and sends a verification email. The response is always 202 Accepted with the same generic body, regardless of whether the email already exists — this is an intentional anti-enumeration control.The password is validated in the domain layer against the
RawPassword value object. The only hard limit enforced at the HTTP layer (before the domain even runs) is a maximum of 72 characters — bcrypt silently truncates input beyond that boundary, so the limit is a defense-in-depth guard. Format rules (minimum length, complexity) are owned by the domain.Verify the email address
The verification email contains a link that carries a single-use token. Your frontend extracts that token and posts it to Response — 200 OKIf the verification token is invalid, expired, or already consumed, the service returns Response — 202 Accepted
/auth/verify. A successful response means the account is now ACTIVE. Unlike registration, this endpoint does return a distinguishable 400 on failure — the caller already possesses the token, so there is no enumeration risk.400 Bad Request with a application/problem+json body.Resend a verification emailIf the user needs a new verification link, call /auth/resend-verification. Like /auth/register, this endpoint always returns 202 Accepted with a generic body — the same response is returned whether the account exists, is already verified, or never existed.Log in with credentials
Once the account is Response — 200 OK
ACTIVE, the user can exchange their email and password for an access token and a refresh token.| Field | Description |
|---|---|
accessToken | HS256-signed JWT. Valid for 15 minutes (expiresInSeconds: 900). Stateless — not persisted. |
refreshToken | Opaque random value. Valid for 7 days. Stored as a SHA-256 hash in the database. |
tokenType | Always "Bearer". |
expiresInSeconds | Access token TTL in seconds (900 = 15 min). |
Use the access token
Pass the The access token expires after 15 minutes. Use the
accessToken as a Bearer token in the Authorization header of every request to protected endpoints.refreshToken to obtain a new pair — see the Token Management guide.Account statuses
Auth Service models account lifecycle with four statuses. OnlyACTIVE accounts can log in or use a refresh token to rotate credentials.
PENDING_VERIFICATION
The account was just registered. Login and token refresh are blocked until the email address is verified.
ACTIVE
The email has been verified. The account can log in and use all authenticated endpoints.
LOCKED
The account has been locked — for example, after a brute-force detection event (Story 3.2, backlog). Login and refresh are blocked.
DISABLED
The account has been administratively disabled (Epic 4, backlog). Login and refresh are blocked.
Roles
Auth Service assigns every account one or more roles, which appear as aroles array in the JWT payload.
| Role | Description |
|---|---|
USER | Default role assigned at registration. Grants access to standard user endpoints such as GET /api/v1/users/me. |
ADMIN | Elevated role. Required for administrative operations introduced in Epic 4. Assigned manually or via the initial admin provisioning env vars. |