aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorKana <[email protected]>2019-03-01 12:50:48 +0900
committerGitHub <[email protected]>2019-03-01 12:50:48 +0900
commit47ca404b6bc45b0626b19c076da3fea5412404a7 (patch)
tree1ecd2afbe8a606193999ec59112d2e8269826f39 /src/api
parenttodo (diff)
downloadhost.fuwn.me-47ca404b6bc45b0626b19c076da3fea5412404a7.tar.xz
host.fuwn.me-47ca404b6bc45b0626b19c076da3fea5412404a7.zip
Update uploadPOST.js
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/files/uploadPOST.js8
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);
}