Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Commit 2fbcdcf

Browse files
committed
fix(claims): 🚑 Create claim image only when logged in
1 parent 0b9ffc6 commit 2fbcdcf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/controllers/ClaimController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class ClaimController {
517517
const claim = await this.core.getPrisma().claim.findFirst({
518518
where: {
519519
id: req.params.id,
520-
ownerId: req.user.id,
520+
ownerId: req.user.id, // TODO
521521
},
522522
select: {
523523
images: { where: { id: req.params.image } },

src/controllers/GeneralController.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class GeneralController {
7171
}
7272
let opts = undefined;
7373

74+
if (!req.kauth) {
75+
return ERROR_GENERIC(req, res, 500, "Unidentified User.");
76+
}
77+
7478
if (req.query.claim) {
7579
opts = { Claim: { connect: { id: req.query.claim as string } } };
7680
}

0 commit comments

Comments
 (0)