diff --git a/.env.example b/.env.example index e219aa3..5862588 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ MONGODB= -JWT_SECRET= \ No newline at end of file +JWT_SECRET= +SERVER_TOKEN= \ No newline at end of file diff --git a/index.mjs b/index.mjs index a9580b9..e42a9f9 100644 --- a/index.mjs +++ b/index.mjs @@ -47,6 +47,10 @@ app.get("/jwt", async (req, res) => { }); app.post("/info", async (req, res) => { + if (req.headers["x-server"] !== process.env.SERVER_TOKEN) { + return res.status(403).send("Not server."); + } + const token = req.headers["x-jwt"]; if (token) { try {