mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
feature complete; tested and working on local linux machine
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user