Authentication Flows
Detailed documentation of all authentication flows, including login, passwordless sign-in, workspace switching, and social account linking.
Login (POST /auth/login)β
The standard email/password login flow includes several security hardening measures:
- Fetches all users matching the email (multi-tenant support).
- Performs constant-time password comparison (
timingSafeEqual) β prevents timing attacks. - Progressive hash migration β Legacy bcrypt hashes are automatically re-hashed to scrypt on successful login.
- Validates employee status (active, not archived).
- Returns
null(genericUnauthorizedException) if no match β prevents user enumeration. - Generates both access and refresh tokens on success.
warning
The login endpoint never reveals whether an email exists in the system. Failed attempts always return a generic UnauthorizedException.