internal/auth
Sign-in, done properly
Every flow a real product needs, with the failure modes handled: enumeration, replay, rate limits, session invalidation.
- Email and password hashed with argon2id (64 MiB, 3 iterations)
- Email verification, password reset, and a magic link that doubles as passwordless signup
- Google, GitHub, Microsoft Entra ID, and any OIDC provider by discovery
- TOTP two-factor: QR enrollment, ten single-use recovery codes, required on every sign-in path
- Neutral answers everywhere — signup, login and reset never reveal whether an account exists
- Rate limits per IP and per account; a password change ends every other session
- One-time tokens stored as SHA-256 hashes, single-use, with a lifetime per purpose
- OAuth never merges accounts silently: an email collision requires an explicit link