mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-31 11:49:01 +08:00
chore(server): add logs to debug missing session
This commit is contained in:
parent
1a54a17b0d
commit
63a6f00a47
@ -64,6 +64,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) {
|
||||
// currently, we're doing that for file upload because handling form data seems to be difficult
|
||||
function checkApiAuthOrElectron(req: Request, res: Response, next: NextFunction) {
|
||||
if (!req.session.loggedIn && !isElectron && !noAuthentication) {
|
||||
console.warn(`Missing session with ID '${req.sessionID}'.`);
|
||||
reject(req, res, "Logged in session not found");
|
||||
} else {
|
||||
next();
|
||||
@ -72,6 +73,7 @@ function checkApiAuthOrElectron(req: Request, res: Response, next: NextFunction)
|
||||
|
||||
function checkApiAuth(req: Request, res: Response, next: NextFunction) {
|
||||
if (!req.session.loggedIn && !noAuthentication) {
|
||||
console.warn(`Missing session with ID '${req.sessionID}'.`);
|
||||
reject(req, res, "Logged in session not found");
|
||||
} else {
|
||||
next();
|
||||
|
Loading…
x
Reference in New Issue
Block a user