mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +00:00
update api key logic
This commit is contained in:
parent
e89c5cfcd3
commit
b0204d3307
@ -10,7 +10,7 @@ const PLEBDEVS_API_KEY = process.env.PLEBDEVS_API_KEY;
|
||||
export default async function handler(req, res) {
|
||||
// make sure api key is in authorization header
|
||||
const apiKey = req.headers['authorization'];
|
||||
if (apiKey !== PLEBDEVS_API_KEY) {
|
||||
if (!apiKey || apiKey !== PLEBDEVS_API_KEY) {
|
||||
res.status(401).json({ error: 'Unauthorized' });
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user