HOTFIX: Profiles are visible when logged out
This commit is contained in:
@@ -75,17 +75,6 @@ function profileRequestInner(connection, req, res, body) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//validate the credentials
|
|
||||||
let query = 'SELECT COUNT(*) AS total FROM sessions WHERE accountId = ? AND token = ?;';
|
|
||||||
connection.query(query, [body.id, body.token], (err, credentials) => {
|
|
||||||
if (err) throw err;
|
|
||||||
|
|
||||||
if (credentials[0].total !== 1) {
|
|
||||||
res.status(400).write(log('Invalid profile request credentials', JSON.stringify(body), body.id, body.token));
|
|
||||||
res.end();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//results.length === 1
|
//results.length === 1
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
username: body.username,
|
username: body.username,
|
||||||
@@ -97,7 +86,6 @@ function profileRequestInner(connection, req, res, body) {
|
|||||||
});
|
});
|
||||||
res.end();
|
res.end();
|
||||||
log('Profile sent', body.username, body.id, body.token);
|
log('Profile sent', body.username, body.id, body.token);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user