diff --git a/src/services/auth.ts b/src/services/auth.ts index c5cdbc9b8..7b946a154 100644 --- a/src/services/auth.ts +++ b/src/services/auth.ts @@ -14,7 +14,10 @@ import optionService from "./options.js"; const noAuthentication = config.General && config.General.noAuthentication === true; function checkAuth(req: AppRequest, res: Response, next: NextFunction) { - if (!req.session.loggedIn && !utils.isElectron() && !noAuthentication) { + if (!sqlInit.isDbInitialized()) { + res.redirect("setup"); + } + else if (!req.session.loggedIn && !utils.isElectron() && !noAuthentication) { if (optionService.getOption('redirectBareDomain') === 'true') { res.redirect('/share'); } else {