mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03:22:04 -04:00
Actually save cookies
This commit is contained in:
@@ -113,7 +113,13 @@ public class KfTokenService
|
||||
throw new Exception("data-logged-in attribute missing");
|
||||
}
|
||||
|
||||
return html.Attributes["data-logged-in"].Value == "true";
|
||||
var success = html.Attributes["data-logged-in"].Value == "true";
|
||||
if (success)
|
||||
{
|
||||
await SaveCookies();
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public async Task PerformLogin(string username, string password)
|
||||
|
||||
@@ -187,7 +187,7 @@ public class KiwiFlare(string kfDomain, string? proxy = null, CancellationToken?
|
||||
_logger.Debug($"Set-Cookie header -> {JsonSerializer.Serialize(response.Headers.GetValues("Set-Cookie"))}");
|
||||
var header = response.Headers.GetValues("Set-Cookie").First();
|
||||
var token = $"{header.Split("ttrs_clearance=")[1].Split("; ")[0]}";
|
||||
_logger.Debug($"Parsed token form the header: {token}");
|
||||
_logger.Debug($"Parsed token from the header: {token}");
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user