Skip to content

Commit

Permalink
update: added passphrase to validate certificate post requests
Browse files Browse the repository at this point in the history
  • Loading branch information
sambhavsaxena committed Dec 2, 2023
1 parent 5320098 commit e7a6b26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/controllers/certificateController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const getCertificate = asyncHandler(async (req, res) => {
});

const CreateCertificate = asyncHandler(async (req, res) => {
const { cid, driveURL } = req.body;
const { cid, driveURL, passphrase } = req.body;
if (passphrase !== process.env.PASSPHRASE) {
res.status(401).json({ message: "Unauthorized!" });
}
if (!cid || !driveURL) {
res.status(404).json({ message: "Please fill out all the fields!" });
}
Expand Down

0 comments on commit e7a6b26

Please sign in to comment.