Started preliminary testing with local api-key. So far working.

- Need to fix response statuscodes
- Need to test when strict not enabled
- Need to test why sIO is not working
- Need to test with userpassword
- Need to add a secret way of storing allowed api-key
This commit is contained in:
Kasper Rynning-Tønnesen
2019-01-18 17:35:33 +01:00
parent 1ff0de31bc
commit 07e44ec947
3 changed files with 70 additions and 10 deletions

View File

@@ -438,7 +438,7 @@ function left_channel(coll, guid, short_id, in_list, socket, change, caller) {
}
function checkTimeout(type, timeout, channel, guid, conf_pass, this_pass, socket, callback, error_message){
function checkTimeout(type, timeout, channel, guid, conf_pass, this_pass, socket, callback, error_message, error_callback){
if(conf_pass != "" && conf_pass == this_pass) {
callback();
return;
@@ -454,7 +454,9 @@ function checkTimeout(type, timeout, channel, guid, conf_pass, this_pass, socket
var retry_in = (date.getTime() - now.getTime()) / 1000;
if(retry_in > 0) {
if(error_message) {
if(typeof(error_callback) == "function") {
error_callback();
} else if(error_message) {
var sOrNot = Math.ceil(retry_in) > 1 || Math.ceil(retry_in) == 0 ? "s" : "";
socket.emit("toast", error_message + Math.ceil(retry_in) + " second" + sOrNot + ".");
} else {