Made auth middleware turn skip timeout if maintenance mode is on

This commit is contained in:
2025-02-17 23:31:09 +11:00
parent 556c93fc49
commit 9ea58b0961
4 changed files with 38 additions and 28 deletions

View File

@@ -16,6 +16,7 @@ func NewServer(
logger *zerolog.Logger,
conn *db.SafeConn,
staticFS *http.FileSystem,
maint *uint32,
) http.Handler {
mux := http.NewServeMux()
addRoutes(
@@ -29,7 +30,7 @@ func NewServer(
// Add middleware here, must be added in reverse order of execution
// i.e. First in list will get executed last during the request handling
handler = middleware.Logging(logger, handler)
handler = middleware.Authentication(logger, config, conn, handler)
handler = middleware.Authentication(logger, config, conn, handler, maint)
// Gzip
handler = middleware.Gzip(handler, config.GZIP)