aboutsummaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
authorkanadeko <[email protected]>2017-01-14 05:51:56 -0300
committerkanadeko <[email protected]>2017-01-14 05:51:56 -0300
commitd25193bb3188995f1d360d3f6f38437f062c84c5 (patch)
tree5442edbdda12ba1ede96045ac47cd6a2ecdfc60d /controllers
parentFrontend done (diff)
downloadhost.fuwn.me-d25193bb3188995f1d360d3f6f38437f062c84c5.tar.xz
host.fuwn.me-d25193bb3188995f1d360d3f6f38437f062c84c5.zip
IP whitelisting
Diffstat (limited to 'controllers')
-rw-r--r--controllers/galleryController.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/controllers/galleryController.js b/controllers/galleryController.js
index f2e914c..c7ea726 100644
--- a/controllers/galleryController.js
+++ b/controllers/galleryController.js
@@ -4,8 +4,9 @@ const db = require('knex')(config.database)
let galleryController = {}
galleryController.list = function(req, res, next){
- //if(!config.privacy.public)
- //if(!config.privacy.IPs.includes(req.ip)) return res.status(401).send('Not Authorized!')
+
+ if(!config.privacy.public)
+ if(!config.privacy.IPs.includes(req.ip)) return res.status(401).send('Not Authorized!')
db.table('gallery').select('id', 'name').then((data) => {
res.json({ data })
@@ -13,8 +14,9 @@ galleryController.list = function(req, res, next){
}
galleryController.test = function(req, res, next){
- //if(!config.privacy.public)
- //if(!config.privacy.IPs.includes(req.ip)) return res.status(401).send('Not Authorized!')
+
+ if(!config.privacy.public)
+ if(!config.privacy.IPs.includes(req.ip)) return res.status(401).send('Not Authorized!')
let testdata = [
{name: 'Test 1'},