forked from zombieb/undead-universal-patch-il2cpp
Remove galvanic authentication support
... that server is being rewritten
This commit is contained in:
@@ -64,30 +64,6 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
|
||||
if (newUri.ToString().Contains("ns.rec.net")) newUri = new Il2CppSystem.Uri(NameserverConfig.NewUrl.Value);
|
||||
|
||||
if (GalvanicConfig.Enabled.Value)
|
||||
{
|
||||
string[] applyHeader = [
|
||||
"/cachedlogin/forplatformid",
|
||||
"/account/create",
|
||||
"/connect/token"
|
||||
];
|
||||
foreach (string header in applyHeader)
|
||||
{
|
||||
if (newUri.PathAndQuery.Contains(header))
|
||||
{
|
||||
// refresh the token if it expired
|
||||
// this is somewhat inefficient, but we don't hook into many requests (see above) so it should be fine
|
||||
GalvanicWebAuth.TokenExpiry();
|
||||
|
||||
Type httpRequestType = request.GetType();
|
||||
MethodInfo addHeaderMethod = httpRequestType.GetMethod("AddHeader");
|
||||
addHeaderMethod.Invoke(request, ["GalvanicAuth", GalvanicWebAuth.Token]);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_Unob request a-URL: {newUri.ToString()}");
|
||||
uriProperty.SetValue(request, NameserverConfig.Rewrite.Value ? newUri : uriInstance, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user