- 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.

