Auth returns a middleware that validates JWT and sets user context. When sessionsStore and resolved are provided and sessionID is in the token, validates session inactivity timeout and updates last_activity.
(cfg *config.Config, log *slog.Logger)
| 21 | // When sessionsStore and resolved are provided and sessionID is in the token, |
| 22 | // validates session inactivity timeout and updates last_activity. |
| 23 | func Auth(cfg *config.Config, log *slog.Logger) func(http.Handler) http.Handler { |
| 24 | return AuthWithSessionCheck(cfg, nil, nil, log) |
| 25 | } |
| 26 | |
| 27 | // AuthWithSessionCheck returns Auth middleware with session inactivity validation. |
| 28 | func AuthWithSessionCheck(cfg *config.Config, sessionsStore *store.SessionsStore, resolved *config.ResolvedConfig, log *slog.Logger) func(http.Handler) http.Handler { |
nothing calls this directly
no test coverage detected