diff options
Diffstat (limited to 'src/api/routes')
| -rw-r--r-- | src/api/routes/files/uploadPOST.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/api/routes/files/uploadPOST.js b/src/api/routes/files/uploadPOST.js index 920981b..33c4551 100644 --- a/src/api/routes/files/uploadPOST.js +++ b/src/api/routes/files/uploadPOST.js @@ -23,13 +23,7 @@ class uploadPOST extends Route { async run(req, res, db) { const user = await Util.isAuthorized(req); // TODO: .env variables are all casted to strings. pepehands - // https://github.com/niftylettuce/dotenv-parse-variables - dump(user); - dump(process.env.PUBLIC_MODE); - console.log('user', user); - console.log('public_mode', process.env.PUBLIC_MODE); - - if (!user && !process.env.PUBLIC_MODE) return res.status(401).json({ message: 'Not authorized to use this resource' }); + if (!user && process.env.PUBLIC_MODE == 'false') return res.status(401).json({ message: 'Not authorized to use this resource' }); return this.uploadFile(req, res, db, user); } |