From 9ef6f3e9475e208346f85ee0de2021343a851648 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 18 Apr 2025 00:39:17 +0200 Subject: [PATCH] fix(services/auth): fix ERR_HTTP_HEADERS_SENT errors on new unitialized Setups was previously showing two errors: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client --- src/services/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/auth.ts b/src/services/auth.ts index d1d951fc0..3c9c9c8e6 100644 --- a/src/services/auth.ts +++ b/src/services/auth.ts @@ -15,7 +15,7 @@ const noAuthentication = config.General && config.General.noAuthentication === t function checkAuth(req: Request, res: Response, next: NextFunction) { if (!sqlInit.isDbInitialized()) { - res.redirect('setup'); + return res.redirect('setup'); } const currentTotpStatus = totp.isTotpEnabled();