Actually save cookies

This commit is contained in:
barelyprofessional
2026-02-08 20:40:39 -06:00
parent 1e44dbe6c1
commit 4c8cbc1748
2 changed files with 8 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;
}
}