Create src/middleware/adminIp.js
Browse files
src/middleware/adminIp.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ADMIN_IP_ALLOWLIST } from "../config/security.js";
|
| 2 |
+
|
| 3 |
+
export function adminIp(req, res, next) {
|
| 4 |
+
if (!ADMIN_IP_ALLOWLIST.includes(req.ip)) return res.sendStatus(403);
|
| 5 |
+
next();
|
| 6 |
+
}
|