Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication layer for the koan server.

When auth_enabled = true:

  • All GraphQL/Subsonic requests must carry a valid JWT in Authorization: Bearer <token>
  • Auth routes (/auth/login, /auth/refresh, /auth/logout) are always accessible

When auth_enabled = false (default):

  • All requests are treated as admin — no auth required. Same behavior as before this feature.

Modules§

middleware
Axum middleware for JWT authentication.
routes
Auth HTTP routes: login, refresh, logout.

Structs§

AuthUser
Authenticated user context injected into request extensions and GraphQL context.