feature complete; tested and working on local linux machine

This commit is contained in:
matt wilkie
2025-02-16 22:47:50 -07:00
parent bc66e98533
commit ed8b8e50a4
3 changed files with 13 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import { isElectron } from "./utils.js";
import passwordEncryptionService from "./encryption/password_encryption.js";
import config from "./config.js";
import passwordService from "./encryption/password.js";
import options from "./options.js";
import type { NextFunction, Request, Response } from "express";
const noAuthentication = config.General && config.General.noAuthentication === true;
@@ -15,7 +16,8 @@ function checkAuth(req: Request, res: Response, next: NextFunction) {
if (!sqlInit.isDbInitialized()) {
res.redirect("setup");
} else if (!req.session.loggedIn && !isElectron && !noAuthentication) {
res.redirect("share");
const redirectToShare = options.getOption('redirectBareDomain') === 'true';
res.redirect(redirectToShare ? "share" : "login");
} else {
next();
}