From c37686851347ba4b6a407ce8511701e28089e2aa Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 20 Feb 2025 17:30:48 +0700 Subject: [PATCH] auth_service in config file --- config.json | 5 +++-- src/auth/auth.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 2774c6d..a08a57d 100644 --- a/config.json +++ b/config.json @@ -43,5 +43,6 @@ "css": "../src/web/css", "js": "../src/web/js", "root": "../src/web" - } -} \ No newline at end of file + }, + "auth_service": "http://127.0.0.1:43243" +} diff --git a/src/auth/auth.cpp b/src/auth/auth.cpp index 9540906..ece2d52 100644 --- a/src/auth/auth.cpp +++ b/src/auth/auth.cpp @@ -3,10 +3,12 @@ #include #include #include +#include bool authenticate(const std::string &token) { - httplib::Client cli(AUTH_SERVICE); + config::config.setConfig("../config.json") + httplib::Client cli(config::config.getConfig()["auth_service"]); std::string body = R"({"token":")" + token + R"("})"; // body << R"({"token":")" << token << R"("})";