Commit ac5bbd65 authored by jan.koester's avatar jan.koester
Browse files

test

parent f5ec7b68
Loading
Loading
Loading
Loading
Loading
+9 −2
Changes for src/api.cpp: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ public:
        }
    }

    const SessionData* checkUser(json_object *request, json_object * /*response*/) {
    const SessionData* checkUser(json_object *request, json_object *response) {
        json_object* cmd = get_commands_array_or_throw(request);

        int fcount = json_object_array_length(cmd);
@@ -224,7 +224,14 @@ public:
            json_object_object_foreach(json_object_array_get_idx(cmd, i), key, val) {
                if (strcmp(key, "usersession") == 0) {
                    const char* id = json_object_get_string(val);
                    return AuthSession->getSession(id);
                    const SessionData* sd = AuthSession->getSession(id);
                    if (!sd) {
                        json_object *eobj = json_object_new_object();
                        json_object_object_add(eobj, "error",
                            json_object_new_string("session expired or not found"));
                        json_object_array_add(response, eobj);
                    }
                    return sd;
                }
            }
        }