From c63690c181b19844a35ff2ca52ed87ed402da8ac Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Fri, 28 Jun 2024 07:18:27 +0000 Subject: [PATCH] fix linting --- src/utils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils.js b/src/utils.js index cfd3745..7cd20ff 100644 --- a/src/utils.js +++ b/src/utils.js @@ -18,7 +18,7 @@ export async function checkAuth (cookies, res, vmpath = null) { const userObj = getUserObjFromUsername(cookies.username); if (!userObj) { res.status(401).send({ auth, path: vmpath ? `${vmpath}/config` : "/version", error: "Username was missing or invalid." }); - res.end() + res.end(); return false; } @@ -368,12 +368,12 @@ export function readJSONFile (path) { export function getUserObjFromUsername (username) { if (username) { - const userRealm = username.split("@").at(-1); - const userID = username.replace(`@${userRealm}`, ""); - const userObj = { id: userID, realm: userRealm }; - return userObj; + const userRealm = username.split("@").at(-1); + const userID = username.replace(`@${userRealm}`, ""); + const userObj = { id: userID, realm: userRealm }; + return userObj; } else { - return null + return null; } }