Skip to content

Build your personal knowledge base with Trilium Notes

fix(services/auth): fix ERR_HTTP_HEADERS_SENT errors on new unitialized Setups

Panagiotis Papadopoulos9ef6f3e9475e
diff --git a/src/services/auth.ts b/src/services/auth.ts
index d1d951fc0c..3c9c9c8e60 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();