mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Fixed issue with people being able to skip multiple times
This commit is contained in:
@@ -304,7 +304,7 @@ router.route('/api/skip/:channel_name').post(function(req, res) {
|
|||||||
var guid = req.body.chat_name;
|
var guid = req.body.chat_name;
|
||||||
var channel_name = cleanChannelName(req.params.channel_name);
|
var channel_name = cleanChannelName(req.params.channel_name);
|
||||||
var userpass = "";
|
var userpass = "";
|
||||||
if(req.body.userpass) userpass = crypto.createHash('sha256').update(Functions.decrypt_string(req.body.userpass)).digest("base64");
|
if(req.body.userpass && req.body.userpass != "") userpass = crypto.createHash('sha256').update(Functions.decrypt_string(req.body.userpass)).digest("base64");
|
||||||
if(allowed_key.indexOf(api_key) > -1) {
|
if(allowed_key.indexOf(api_key) > -1) {
|
||||||
db.collection(channel_name + "_settings").find({"id": "config"}, function(err, settings) {
|
db.collection(channel_name + "_settings").find({"id": "config"}, function(err, settings) {
|
||||||
if(settings.length == 0) {
|
if(settings.length == 0) {
|
||||||
@@ -357,7 +357,9 @@ router.route('/api/skip/:channel_name').post(function(req, res) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// WRONG API KEY
|
// WRONG API KEY
|
||||||
res.status(406).send(error.not_authenticated);
|
var toSend = error.not_authenticated;
|
||||||
|
toSend.status = 406;
|
||||||
|
res.status(406).send(toSend);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user