Imports
auth usage modes
await auth(request, options?): request-aware auth contextauth(headers): deserialize middleware-propagated auth context
auth.protect(options)
Supports:
- auth checks
- permission checks
- token acceptance constraints:
session_token | api_key | oauth_token | machine_token | any
Middleware contract
wachtMiddleware(handler?, options?):
- normalizes
__dev_session__query tokens - performs session exchange when needed
- applies auth/sync headers to outgoing response
- redirects for browser-like routes, JSON errors for API-like routes
