mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-28 19:23:47 +02:00
Save cookies per user (no 2FA on account switch)
This commit is contained in:
17
WebApi.cs
17
WebApi.cs
@@ -106,6 +106,23 @@ namespace VRCX
|
||||
}
|
||||
}
|
||||
|
||||
public string GetCookies()
|
||||
{
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
new BinaryFormatter().Serialize(memoryStream, _cookieContainer);
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCookies(string cookies)
|
||||
{
|
||||
using (var stream = new MemoryStream(Convert.FromBase64String(cookies)))
|
||||
{
|
||||
_cookieContainer = (CookieContainer)new BinaryFormatter().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS4014
|
||||
public async void Execute(IDictionary<string, object> options, IJavascriptCallback callback)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user