fix(api): 🔒 Correctly check for note ownership when editing

This commit is contained in:
Jesse Wierzbinski 2024-11-19 17:26:14 +01:00
parent 653cf712ea
commit 9682cd0f99
No known key found for this signature in database
10 changed files with 40 additions and 36 deletions

View file

@ -81,7 +81,7 @@ export default apiRoute((app) =>
foundAuthor = foundObject ? foundObject.author : null;
if (foundObject) {
if (!foundObject.isViewableByUser(null)) {
if (!(await foundObject.isViewableByUser(null))) {
return context.json({ error: "Object not found" }, 404);
}
} else {