This commit is contained in:
Matt DiMeglio 2026-01-18 00:32:15 -05:00
parent 17546c63ad
commit c48b8fa250

View file

@ -5,7 +5,7 @@ export const validateMedicationApiKey = (req, res, next) => {
console.log('authHeader: ', authHeader); console.log('authHeader: ', authHeader);
const token = authHeader && authHeader.split(' ')[1]; const token = authHeader && authHeader.split(' ')[1];
console.log('token: ', token); console.log('token: ', token);
console.log('process.env.MEDICATION_API_KEY: ', process.env.MEDICATION_API_KEY);
if (!token || token !== process.env.MEDICATION_API_KEY) { if (!token || token !== process.env.MEDICATION_API_KEY) {
console.log('into the token not ok'); console.log('into the token not ok');
return res.status(401).json({ error: 'Unauthorized - Invalid API Key' }); return res.status(401).json({ error: 'Unauthorized - Invalid API Key' });