From fa7071ecb688ad8a79917ff9a9946c606d629c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 2 Mar 2018 13:23:32 +0100 Subject: [PATCH] Correct output for output on post without auth --- server/routing/client/api.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/routing/client/api.js b/server/routing/client/api.js index c04636ea..af6240e3 100644 --- a/server/routing/client/api.js +++ b/server/routing/client/api.js @@ -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;