mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +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) {
|
export default async function handler(req, res) {
|
||||||
// make sure api key is in authorization header
|
// make sure api key is in authorization header
|
||||||
const apiKey = req.headers['authorization'];
|
const apiKey = req.headers['authorization'];
|
||||||
if (apiKey !== PLEBDEVS_API_KEY) {
|
if (!apiKey || apiKey !== PLEBDEVS_API_KEY) {
|
||||||
res.status(401).json({ error: 'Unauthorized' });
|
res.status(401).json({ error: 'Unauthorized' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user