fix bug in disk routes using getUserObjFromUsername
This commit is contained in:
@@ -140,9 +140,9 @@ router.post("/:disk/resize", async (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// attempt to parse user from username
|
// attempt to parse user from username
|
||||||
const userObj = global.utils.getUserObjFromUsername(params.username);
|
const userObj = global.utils.getUserObjFromUsername(req.cookies.username);
|
||||||
if (userObj == null) {
|
if (userObj == null) {
|
||||||
res.status(400).send({ auth:true, error:`username ${params.username} does not match format uid@realm.` });
|
res.status(400).send({ auth:true, error:`username ${req.cookies.username} does not match format uid@realm.` });
|
||||||
}
|
}
|
||||||
|
|
||||||
// check auth for specific instance
|
// check auth for specific instance
|
||||||
@@ -211,9 +211,9 @@ router.post("/:disk/move", async (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// attempt to parse user from username
|
// attempt to parse user from username
|
||||||
const userObj = global.utils.getUserObjFromUsername(params.username);
|
const userObj = global.utils.getUserObjFromUsername(req.cookies.username);
|
||||||
if (userObj == null) {
|
if (userObj == null) {
|
||||||
res.status(400).send({ auth:true, error:`username ${params.username} does not match format uid@realm.` });
|
res.status(400).send({ auth:true, error:`username ${req.cookies.username} does not match format uid@realm.` });
|
||||||
}
|
}
|
||||||
|
|
||||||
// check auth for specific instance
|
// check auth for specific instance
|
||||||
@@ -337,10 +337,13 @@ router.post("/:disk/create", async (req, res) => {
|
|||||||
iso: req.body.iso
|
iso: req.body.iso
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(req.cookies)
|
||||||
|
|
||||||
// attempt to parse user from username
|
// attempt to parse user from username
|
||||||
const userObj = global.utils.getUserObjFromUsername(params.username);
|
const userObj = global.utils.getUserObjFromUsername(req.cookies.username);
|
||||||
if (userObj == null) {
|
if (userObj == null) {
|
||||||
res.status(400).send({ auth:true, error:`username ${params.username} does not match format uid@realm.` });
|
res.status(400).send({ auth:true, error:`username ${req.cookies.username} does not match format uid@realm.` });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check auth for specific instance
|
// check auth for specific instance
|
||||||
|
|||||||
Reference in New Issue
Block a user