mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Network: Refactor local/remote ip address selection code and allow using hostnames in LoginREST bnetserver config options
This commit is contained in:
@@ -232,11 +232,11 @@ uint32 Battlenet::Session::HandleLogon(authentication::v1::LogonRequest const* l
|
||||
if (logonRequest->has_cached_web_credentials())
|
||||
return VerifyWebCredentials(logonRequest->cached_web_credentials(), continuation);
|
||||
|
||||
boost::asio::ip::tcp::endpoint const& endpoint = sLoginService.GetAddressForClient(GetRemoteIpAddress());
|
||||
std::string const& hostname = sLoginService.GetHostnameForClient(GetRemoteIpAddress());
|
||||
|
||||
challenge::v1::ChallengeExternalRequest externalChallenge;
|
||||
externalChallenge.set_payload_type("web_auth_url");
|
||||
externalChallenge.set_payload(Trinity::StringFormat("https://{}:{}/bnetserver/login/", endpoint.address().to_string(), endpoint.port()));
|
||||
externalChallenge.set_payload(Trinity::StringFormat("https://{}/bnetserver/login/", hostname));
|
||||
Service<challenge::v1::ChallengeListener>(this).OnExternalChallenge(&externalChallenge);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user