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
This commit is contained in:
Panagiotis Papadopoulos 2025-04-18 00:39:17 +02:00
parent 3b69eadbf6
commit 9ef6f3e947

View File

@ -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();