fixed? an issue with client auth

This commit is contained in:
2026-01-14 00:41:49 +01:00
parent 1c7a72d66e
commit e51477236b
+7 -3
View File
@@ -40,13 +40,17 @@ app.get("/v1/auth", (req, res) => {
if(accounts[req.headers.username] === undefined)
passed = false
if(bcrypt.compareSync(accounts[req.headers.username],req.headers.password))
if(!bcrypt.compareSync(req.headers.password, accounts[req.headers.username]))
passed = false
if(passed)
console.log(passed);
if(passed){
res.status(200).json(apikeys);
else
}
else{
res.status(401).send("You are not authorised");
}
fs.writeFile("access.log", `${logTime} : ${req.ip} API KEY REQUEST ${passed?"SUCCESS":"FAILED"}\n`, { flag: "a" }, callback => {});