mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Add more info to return to backend's /pkToUser endpoint (#332)
Features added were tested through a custom client (since @sla-ppy is too cheap to own the game) with @lionkor while pair programming. Fixes: #303
This commit is contained in:
commit
2fcb53530a
@ -289,16 +289,21 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
||||
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 {};
|
||||
std::string AuthResStr {};
|
||||
try {
|
||||
AuthReq = nlohmann::json {
|
||||
{ "key", key }
|
||||
{ "key", Key },
|
||||
{ "auth_key", AuthKey },
|
||||
{ "client_ip", ClientIp }
|
||||
};
|
||||
|
||||
auto Target = "/pkToUser";
|
||||
|
||||
unsigned int ResponseCode = 0;
|
||||
AuthResStr = Http::POST(Application::GetBackendUrlForAuth(), 443, Target, AuthReq.dump(), "application/json", &ResponseCode);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user