mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
Fixed bug that caused people to upload as anon even if running private
This commit is contained in:
parent
55ae8c3288
commit
14cf45c168
@ -42,8 +42,14 @@ uploadsController.upload = function(req, res, next) {
|
|||||||
if (token === undefined) token = ''
|
if (token === undefined) token = ''
|
||||||
|
|
||||||
db.table('users').where('token', token).then((user) => {
|
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
|
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
|
// Check if user is trying to upload to an album
|
||||||
let album
|
let album
|
||||||
|
Loading…
Reference in New Issue
Block a user