Remove Console Logs
This commit is contained in:
parent
c48b8fa250
commit
f7da171561
2 changed files with 4 additions and 8 deletions
|
|
@ -1,16 +1,11 @@
|
|||
export const validateMedicationApiKey = (req, res, next) => {
|
||||
console.log('req: ', req);
|
||||
console.log('req.headers: ', req.headers);
|
||||
const authHeader = req.headers['authorization'];
|
||||
console.log('authHeader: ', authHeader);
|
||||
const token = authHeader && authHeader.split(' ')[1];
|
||||
console.log('token: ', token);
|
||||
console.log('process.env.MEDICATION_API_KEY: ', process.env.MEDICATION_API_KEY);
|
||||
|
||||
if (!token || token !== process.env.MEDICATION_API_KEY) {
|
||||
console.log('into the token not ok');
|
||||
console.log('MEDICATION - User entered an Invalid token: ', token);
|
||||
return res.status(401).json({ error: 'Unauthorized - Invalid API Key' });
|
||||
}
|
||||
console.log('off to next');
|
||||
next();
|
||||
};
|
||||
|
||||
|
|
@ -19,6 +14,7 @@ export const validateShiftSyncApiKey = (req, res, next) => {
|
|||
const token = authHeader && authHeader.split(' ')[1];
|
||||
|
||||
if (!token || token !== process.env.SHIFTSYNC_API_KEY) {
|
||||
console.log('SHIFT - User entered an Invalid token: ', token);
|
||||
return res.status(401).json({ error: 'Unauthorized - Invalid API Key' });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const getBaseMedications = async () => {
|
|||
const dataResp = medicationHelpers.getBaseMedications();
|
||||
return dataResp;
|
||||
} catch (err) {
|
||||
console.log('GET MEDICATIONS ERROR: ', err);
|
||||
console.log('GET BASE MEDICATIONS ERROR: ', err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue