Protected pages rely on the same utilities shipped with the Starter Kit:Documentation Index
Fetch the complete documentation index at: https://devkit4ai.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Server components call
requireAuth()(and optionallyrequireRole) fromlib/auth-server.tsto redirect unauthenticated users to/loginwith a sanitized return URL. - Client components can reuse
useIsAuthenticated()oruseRequireRole()to conditionally render UI once the cached user is available. - Middleware in
middleware.tsinjectsx-pathnameheaders for return URL support without performing auth logic, matching the production setup.

