From 0aa1d602a1539ed38b61e216cdcdad5d8b976235 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Wed, 26 Feb 2025 08:45:35 +0100 Subject: [PATCH 1/2] fix(routes/login): add missing "appPath" to ejs render --- src/routes/login.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/login.ts b/src/routes/login.ts index 68b98e893..e3c1a61fb 100644 --- a/src/routes/login.ts +++ b/src/routes/login.ts @@ -46,7 +46,8 @@ function setPassword(req: Request, res: Response) { if (error) { res.render("set_password", { error, - assetPath: assetPath + assetPath: assetPath, + appPath: appPath }); return; } @@ -65,7 +66,8 @@ function login(req: Request, res: Response) { return res.status(401).render("login", { failedAuth: true, - assetPath: assetPath + assetPath: assetPath, + appPath: appPath }); } From 1a0c35f43d960adc7b70a0c084e7d5f66311ccda Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Wed, 26 Feb 2025 08:50:36 +0100 Subject: [PATCH 2/2] refactor(routes/login): use "shorter" syntax for passing to ejs render --- src/routes/login.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/login.ts b/src/routes/login.ts index e3c1a61fb..a739faa2e 100644 --- a/src/routes/login.ts +++ b/src/routes/login.ts @@ -13,16 +13,16 @@ import type { Request, Response } from "express"; function loginPage(req: Request, res: Response) { res.render("login", { failedAuth: false, - assetPath: assetPath, - appPath: appPath + assetPath, + appPath }); } function setPasswordPage(req: Request, res: Response) { res.render("set_password", { error: false, - assetPath: assetPath, - appPath: appPath + assetPath, + appPath }); } @@ -46,8 +46,8 @@ function setPassword(req: Request, res: Response) { if (error) { res.render("set_password", { error, - assetPath: assetPath, - appPath: appPath + assetPath, + appPath }); return; } @@ -66,8 +66,8 @@ function login(req: Request, res: Response) { return res.status(401).render("login", { failedAuth: true, - assetPath: assetPath, - appPath: appPath + assetPath, + appPath }); }