update
This commit is contained in:
@@ -177,7 +177,8 @@ function isOriginAllowed(origin) {
|
||||
function verifyToken(req, res, next) {
|
||||
const token = req.headers["token"];
|
||||
if (!token || token !== process.env.API_TOKEN) {
|
||||
throw new Error("Token not provided");
|
||||
res.status(401).json({ message: "Token not provided" });
|
||||
return;
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user