mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
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:
parent
3b69eadbf6
commit
9ef6f3e947
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user