Base setup

This commit is contained in:
Barry Low committed 2018-12-07 19:14:14 -08:00
commit beeccd7e3d
40 files changed
+7288

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import { logger } from '../logger'
export const moduleAuth = async (req, res, next, db) => {
if (req.headers.preshared === process.env.PRESHARED_GATEWAY_KEY) {
logger.info('Module authenticated')
next();
} else {
logger.error('Module authentication error')
res.send(wrongPreshared);
}
}
export default moduleAuth