fix linting
This commit is contained in:
parent
34f2669ab9
commit
c63690c181
12
src/utils.js
12
src/utils.js
@ -18,7 +18,7 @@ export async function checkAuth (cookies, res, vmpath = null) {
|
|||||||
const userObj = getUserObjFromUsername(cookies.username);
|
const userObj = getUserObjFromUsername(cookies.username);
|
||||||
if (!userObj) {
|
if (!userObj) {
|
||||||
res.status(401).send({ auth, path: vmpath ? `${vmpath}/config` : "/version", error: "Username was missing or invalid." });
|
res.status(401).send({ auth, path: vmpath ? `${vmpath}/config` : "/version", error: "Username was missing or invalid." });
|
||||||
res.end()
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,12 +368,12 @@ export function readJSONFile (path) {
|
|||||||
|
|
||||||
export function getUserObjFromUsername (username) {
|
export function getUserObjFromUsername (username) {
|
||||||
if (username) {
|
if (username) {
|
||||||
const userRealm = username.split("@").at(-1);
|
const userRealm = username.split("@").at(-1);
|
||||||
const userID = username.replace(`@${userRealm}`, "");
|
const userID = username.replace(`@${userRealm}`, "");
|
||||||
const userObj = { id: userID, realm: userRealm };
|
const userObj = { id: userID, realm: userRealm };
|
||||||
return userObj;
|
return userObj;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user