update for cross compile

This commit is contained in:
wt committed 2024-12-02 04:01:55 +07:00
1 parent 8accbdc476
commit e89bc07659
127 files changed
+238 -15518

No files matched your search

+2 -3
View File
@@ -2,7 +2,7 @@
#include "../colors.h"
#include "../includes.hpp"
#include "../auth/auth.hpp"
#include <jwt-cpp/jwt.h>
#include <jwt.hpp>
#include <syslog.h>
// function for get all users data without password
@@ -26,8 +26,7 @@ void get_all_users(const httplib::Request &request, httplib::Response &response)
syslog(LOG_ERR, "access reject in get all user request");
return;
}
jwt::decoded_jwt<jwt::traits::kazuho_picojson> decoded_token = jwt::decode(json_body["token"]);
std::string userid = decoded_token.get_payload_json()["userId"].to_str();
std::string userid = JWT::get_payload(json_body["token"], JWT_DEFAULT_SECRET)["userId"];
if (userid.empty()) {
response.set_content(STRING403, JSON_TYPE);
syslog(LOG_ERR, "access reject in get all user request");