Fixed issue where userpass not existing

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-13 18:16:08 +01:00
parent ed38c213ac
commit c3e982ee8a
3 changed files with 4 additions and 2 deletions

View File

@@ -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});

View File

@@ -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) {

View File

@@ -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;
}