Log whether cookies could be reused

This commit is contained in:
Cyan Kneelawk 2025-04-28 13:30:10 -07:00
parent 972493ace8
commit 312e94aaf3
No known key found for this signature in database
GPG key ID: 4C8CCF8C0E9D1377

View file

@ -74,6 +74,8 @@ async Task LogInAllAccounts()
var curUserResp = await httpClient.GetAsync("/api/1/auth/user");
if (!curUserResp.IsSuccessStatusCode)
{
Console.WriteLine($"Unable to use cached cookies for {account.username}. Getting new ones...");
string encodedUsername = HttpUtility.UrlEncode(account.username);
string encodedPassword = HttpUtility.UrlEncode(account.password);
@ -116,6 +118,10 @@ async Task LogInAllAccounts()
curUserResp = await httpClient.GetAsync("/api/1/auth/user");
}
else
{
Console.WriteLine($"Using cached cookies for {account.username}");
}
var curUser = await curUserResp.Content.ReadFromJsonAsync<User>();
Console.WriteLine($"Logged in as {curUser?.displayName}");