Loading src/api.cpp +9 −2 Changes for src/api.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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; } } } Loading Loading
src/api.cpp +9 −2 Changes for src/api.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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; } } } Loading