aboutsummaryrefslogtreecommitdiff
path: root/controllers/uploadController.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2017-04-03 17:29:10 -0300
committerPitu <[email protected]>2017-04-03 17:29:10 -0300
commit14cf45c168a6bdb5e0cd37a4bfc0ebc093a890f4 (patch)
tree8fa4cca789ce2884b5bd0d5c1ec19c477767bb43 /controllers/uploadController.js
parentUpdated blocked extensions. (#23) (diff)
downloadhost.fuwn.me-14cf45c168a6bdb5e0cd37a4bfc0ebc093a890f4.tar.xz
host.fuwn.me-14cf45c168a6bdb5e0cd37a4bfc0ebc093a890f4.zip
Fixed bug that caused people to upload as anon even if running private
Diffstat (limited to 'controllers/uploadController.js')
-rw-r--r--controllers/uploadController.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js
index 0207253..400b559 100644
--- a/controllers/uploadController.js
+++ b/controllers/uploadController.js
@@ -42,8 +42,14 @@ uploadsController.upload = function(req, res, next) {
if (token === undefined) token = ''
db.table('users').where('token', token).then((user) => {
+
+ if(user.length === 0)
+ if(config.private === true)
+ return res.status(401).json({ success: false, description: 'Invalid token provided' })
+
let userid
- if (user.length > 0) userid = user[0].id
+ if(user.length > 0)
+ userid = user[0].id
// Check if user is trying to upload to an album
let album