From c3e982ee8a82c8cbb7e42cf22f1b35b1599ccf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 13 Mar 2018 18:16:08 +0100 Subject: [PATCH] Fixed issue where userpass not existing --- server/app.js | 1 + server/public/assets/js/functions.js | 1 + server/routing/client/api.js | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/app.js b/server/app.js index f0cbf0f3..3e7e223b 100644 --- a/server/app.js +++ b/server/app.js @@ -9,6 +9,7 @@ num_processes = require('os').cpus().length; publicPath = path.join(__dirname, 'public'); pathThumbnails = __dirname; + try { var redis = require("redis"); var client = redis.createClient({host: "localhost", port: 6379}); diff --git a/server/public/assets/js/functions.js b/server/public/assets/js/functions.js index 1f29a60d..100c0f79 100644 --- a/server/public/assets/js/functions.js +++ b/server/public/assets/js/functions.js @@ -181,6 +181,7 @@ function get_list_ajax() { } }, error: function(response) { + console.log(response); if(response.responseJSON.status == 403) { start_auth(); } else if(response.responseJSON.status == 429) { diff --git a/server/routing/client/api.js b/server/routing/client/api.js index d45f91fa..81020c70 100644 --- a/server/routing/client/api.js +++ b/server/routing/client/api.js @@ -561,7 +561,7 @@ router.route('/api/list/:channel_name/__np__').post(function(req, res) { if(conf.length == 0) { res.status(404).send(JSON.stringify(error.not_found.list)); return; - } else if(conf[0].userpass != userpass && conf[0].userpass != "") { + } else if(conf[0].userpass != userpass && conf[0].userpass != "" && conf[0].userpass != undefined) { res.status(403).send(JSON.stringify(error.not_authenticated)); return; } @@ -1020,7 +1020,7 @@ router.route('/api/list/:channel_name').post(function(req, res) { if(conf.length == 0) { res.status(404).send(JSON.stringify(error.not_found.list)); return; - } else if(conf[0].userpass != userpass && conf[0].userpass != "") { + } else if(conf[0].userpass != userpass && conf[0].userpass != "" && conf[0].userpass != undefined) { res.status(403).send(JSON.stringify(error.not_authenticated)); return; }