Skip to content

Commit

Permalink
Fucked up public endpoint that idk
Browse files Browse the repository at this point in the history
  • Loading branch information
arctixdev committed Jun 3, 2024
1 parent 8f42720 commit 6de6cb2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions routes/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@ router.get("/schools/:id/groups", function (req, res, next) {
});
});

router.get('hej', function (req, res, next) {
const authorization = req.headers["authorization"];

if (authorization != "Bearer hey") {
return res
.status(401)
.json({ message: "Unauthorized - Token not provided" });
}

prisma.assignment.update({
where: {
id: 1,
},
data: {
isPublic: true,
},
}).then((data) => {
res.json("success").status(200);
return;
});

res.status(401).json("Failue");
});

router.all("*", function (req, res, next) {
res.status(404).json("Not found");
});
Expand Down

0 comments on commit 6de6cb2

Please sign in to comment.