What problem does it solve? Adding auth to a TanStack Start app is error-prone because route guards (beforeLoad + redirect) only protect the UI while server functions remain directly callable API endpoints. This Skill enforces authorization at the real security boundary — inside server-function handlers and middleware — and provides hardened patterns for sessions, cookies, CSRF, and OAuth. ## Core Features & Use Cases - Two-layer auth architecture: _authed layout routes for UX redirects plus authMiddleware on every private createServerFn as the actual data boundary. - Session and cookie management: useSession sealed cookies or manual __Host- cookies with HttpOnly, Secure, SameSite=Lax flags, plus session rotation on privilege changes. - Hardening templates: CSRF/origin middleware, per-IP rate limiting, OAuth authorization-code flow with state and PKCE, and enumeration/timing defenses. - Use Case: You are building an admin panel in TanStack Start. Use this Skill to create the _authed layout, attach requireRole('admin') middleware to the deleteUser server function, and wire a rate-limited login endpoint with constant-time password comparison. ## Quick Start Add authentication to my TanStack Start app with a protected _authed layout, an authMiddleware on my server functions, and a secure login endpoint.