What problem does it solve?
Building secure authentication on the server side of a TanStack Start app requires correctly handling session cookies, OAuth flows, CSRF defense, and rate limiting, and mistakes in any of these create exploitable vulnerabilities.
Core Features & Use Cases
- Session Management: Issue, read, and destroy HttpOnly, Secure, SameSite session cookies with the __Host- prefix, including session rotation on privilege changes.
- OAuth Hardening: Implement the authorization-code flow with one-time state and PKCE verifiers stored in short-lived signed cookies.
- Attack Defenses: Apply CSRF origin checks for non-GET RPCs, rate limit login and reset endpoints, and defeat user enumeration in password-reset flows.
- Use Case: When adding login to a TanStack Start app, use this Skill to wire an authMiddleware that loads the session per request, enforce auth inside every server function handler, and rotate sessions on login and password change.
Quick Start
Implement secure login, logout, and session handling for my TanStack Start app using createServerFn with auth middleware and hardened session cookies.