mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-27 06:20:07 +00:00
add more info to return to pkToUser endpoint
This commit is contained in:
1 parent
a3670bff4a
commit
58a7e39419
1 file changed
+9
-2
+9
-2
@@ -289,16 +289,23 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string key(reinterpret_cast<const char*>(Data.data()), Data.size());
|
std::string Key(reinterpret_cast<const char*>(Data.data()), Data.size());
|
||||||
|
std::string AuthKey = Application::Settings.Key;
|
||||||
|
std::string ClientIp = Client->GetIdentifiers().at("ip");
|
||||||
|
|
||||||
nlohmann::json AuthReq {};
|
nlohmann::json AuthReq {};
|
||||||
std::string AuthResStr {};
|
std::string AuthResStr {};
|
||||||
try {
|
try {
|
||||||
AuthReq = nlohmann::json {
|
AuthReq = nlohmann::json {
|
||||||
{ "key", key }
|
{ "key", Key },
|
||||||
|
{ "auth_key", AuthKey },
|
||||||
|
{ "client_ip", ClientIp }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
beammp_debugf("IF YOU SEE THIS AND IT DISPLAYS PROPER INFO, THE FEATURE WORKS: {}", to_string(AuthReq));
|
||||||
|
|
||||||
auto Target = "/pkToUser";
|
auto Target = "/pkToUser";
|
||||||
|
|
||||||
unsigned int ResponseCode = 0;
|
unsigned int ResponseCode = 0;
|
||||||
AuthResStr = Http::POST(Application::GetBackendUrlForAuth(), 443, Target, AuthReq.dump(), "application/json", &ResponseCode);
|
AuthResStr = Http::POST(Application::GetBackendUrlForAuth(), 443, Target, AuthReq.dump(), "application/json", &ResponseCode);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user