SwoffSwoff

Auth

Full schema for swoff.config.json features.auth — every field, its type, default, and description.

features.auth

FieldTypeDefaultDescription
enabledbooleanfalseEnable auth module
type"bearer" | "cookie" | "custom""cookie"Auth adapter type. Determines how Swoff communicates with your auth provider. See auth/adapter.ts in API Reference.
routePathsstring[]["/login", "/logout", "/register", "/api/login", "/api/logout", "/api/register", "/api/refresh", "/api/me"]URL path prefixes that bypass SW caching at build time. Requests matching any of these paths return immediately in the SW fetch handler, before strategy resolution. Auth endpoints must always reach the server.

Note: Token refresh path and user endpoint are now configured inside the generated auth/adapter.ts file, not in swoff.config.json. The adapter provides refresh() and fetchUser() methods with well-known defaults (/api/refresh, /api/me) that you can edit per provider.

On this page