mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Correct output for output on post without auth
This commit is contained in:
@@ -812,7 +812,7 @@ function validateLogin(adminpass, userpass, channel_name, type, res, callback) {
|
||||
} else if(type == "add") {
|
||||
callback(exists, conf, false);
|
||||
} else {
|
||||
res.status(404).send(JSON.stringify(error.not_authenticated));
|
||||
res.status(403).send(JSON.stringify(error.not_authenticated));
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -825,6 +825,10 @@ function postEnd(channel_name, configs, new_song, guid, res, authenticated) {
|
||||
List.getNextSong(channel_name, function() {
|
||||
updateTimeout(guid, res, "POST", function(err, docs) {
|
||||
var to_return = error.no_error;
|
||||
if(!authenticated) {
|
||||
to_return = error.not_authenticated;
|
||||
to_return.success = true;
|
||||
}
|
||||
to_return.results = [new_song];
|
||||
res.status(authenticated ? 200 : 403).send(JSON.stringify(to_return));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user