aa
This commit is contained in:
@@ -26,10 +26,9 @@ const config = {
|
||||
|
||||
// Middleware per verificare l'API Key
|
||||
app.use((req, res, next) => {
|
||||
console.log('Middleware per verificare l\'API Key...')
|
||||
const apiKey = req.headers['x-api-key'];
|
||||
if (apiKey !== API_KEY) {
|
||||
console.error('APIKEY NON CORRETTA !', API_KEY, apiKey);
|
||||
console.error('APIKEY NON CORRETTA !');
|
||||
return res.status(403).json({ error: 'Accesso negato' });
|
||||
}
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user