UUUU
This commit is contained in:
parent
1a78f05b98
commit
fbc6b79830
2
index.js
2
index.js
|
|
@ -41,7 +41,7 @@ global.auth = (req, res, next) => {
|
||||||
if(!process.env.API_KEY) {
|
if(!process.env.API_KEY) {
|
||||||
return next(); // No API key set, allow all requests
|
return next(); // No API key set, allow all requests
|
||||||
}
|
}
|
||||||
if (process.env.API_KEY && req.headers['Authorization'] === process.env.API_KEY) {
|
if (process.env.API_KEY && req.headers['authorization'] === process.env.API_KEY) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
return res.status(401).json({ error: 'Unauthorized' });
|
return res.status(401).json({ error: 'Unauthorized' });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue