Disable auth for development

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-10-12 21:56:11 +01:00
parent 9674ad9392
commit 59a75f811d
2 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"run": "tsc && node dist/app.js", "run": "tsc && node dist/app.js",
"dev": "NODE_ENV=development tsc && node dist/app.js",
"start": "node app.js", "start": "node app.js",
"test": "jest", "test": "jest",
"format": "npx prettier -w ." "format": "npx prettier -w ."

View File

@ -4,6 +4,11 @@ const logger = require("../utils/logger.utils");
module.exports = async function authCheck(req, res, next) { module.exports = async function authCheck(req, res, next) {
//log.out("authMiddlewares: Checking authentication", "dbug"); //log.out("authMiddlewares: Checking authentication", "dbug");
logger.logger.debug("Auth check starting"); logger.logger.debug("Auth check starting");
if (process.env.NODE_ENV === "development") {
logger.logger.warn("DEVELOPMENT MODE - AUTHENTICATION DISABLED")
res.isAuthed = true;
return next()
}
try { try {
var uuid = req.headers.uuid; var uuid = req.headers.uuid;
} catch (err) { } catch (err) {