Spaces:
Paused
Paused
Deploy Bot commited on
Commit ·
27113f7
1
Parent(s): 9c29d4e
Disable API auth for public shop
Browse files- src/api/middleware.js +5 -0
src/api/middleware.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
const Settings = require('../models/Settings');
|
| 2 |
|
| 3 |
const authMiddleware = async (req, res, next) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
try {
|
| 5 |
const apiKey = req.headers['x-api-key'];
|
| 6 |
|
|
@@ -19,6 +23,7 @@ const authMiddleware = async (req, res, next) => {
|
|
| 19 |
console.error("Auth Error:", e);
|
| 20 |
res.status(500).json({ error: 'Server Error' });
|
| 21 |
}
|
|
|
|
| 22 |
};
|
| 23 |
|
| 24 |
module.exports = authMiddleware;
|
|
|
|
| 1 |
const Settings = require('../models/Settings');
|
| 2 |
|
| 3 |
const authMiddleware = async (req, res, next) => {
|
| 4 |
+
// Authentication disabled for public shop API
|
| 5 |
+
next();
|
| 6 |
+
|
| 7 |
+
/* Original auth code (disabled):
|
| 8 |
try {
|
| 9 |
const apiKey = req.headers['x-api-key'];
|
| 10 |
|
|
|
|
| 23 |
console.error("Auth Error:", e);
|
| 24 |
res.status(500).json({ error: 'Server Error' });
|
| 25 |
}
|
| 26 |
+
*/
|
| 27 |
};
|
| 28 |
|
| 29 |
module.exports = authMiddleware;
|