updated for classes and small fix web
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
This commit is contained in:
1 parent
a19e44188a
commit
40ccbd6ad2
13 files changed
+50
-43
No files matched your search
@@ -22,14 +22,14 @@ namespace AuthService
|
||||
}
|
||||
|
||||
// function for add user
|
||||
void add_user(const httplib::Request& request, httplib::Response& response)
|
||||
void Users::add_user(const httplib::Request& request, httplib::Response& response)
|
||||
{
|
||||
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
|
||||
response.set_header("Access-Control-Allow-Origin", "*");
|
||||
AuthService::Includes::check_body_empty(request, response, ADD_USER_REQUIRED_STRING);
|
||||
nlohmann::json json_body = nlohmann::json::parse(request.body);
|
||||
AuthService::Includes::check_body_data(json_body, "token", response, ADD_USER_REQUIRED_STRING);
|
||||
AuthService::Auth::verify_auth(json_body["token"], response);
|
||||
AuthService::Auth::Auth::verify_auth(json_body["token"], response);
|
||||
AuthService::Includes::check_body_data(json_body, "username", response, ADD_USER_REQUIRED_STRING);
|
||||
AuthService::Includes::check_body_data(json_body, "password", response, ADD_USER_REQUIRED_STRING);
|
||||
std::string userid = JWT::get_payload(json_body["token"], JWT_SECRET_KEY)["userId"];
|
||||
|
||||
Reference in new issue
Block a user