[CHANGE] Fixed storing account/channel
This commit is contained in:
@@ -105,8 +105,23 @@ public class ClientService(IServiceScopeFactory scopeFactory, ILogger<ClientServ
|
||||
LogEvent("Failed to store client no ID!", LogSeverity.Warning);
|
||||
return ResultError.Fail("Client does not have an ID, cannot save to library database!");
|
||||
}
|
||||
|
||||
List<HttpCookieEntity> httpCookies = [];
|
||||
httpCookies.AddRange(client.CookieContainer.GetAllCookies()
|
||||
.ToList()
|
||||
.Select(cookie => new HttpCookieEntity
|
||||
{
|
||||
ClientId = client.Id,
|
||||
Name = cookie.Name,
|
||||
Value = cookie.Value,
|
||||
Domain = cookie.Domain,
|
||||
Path = cookie.Path,
|
||||
Secure = cookie.Secure,
|
||||
HttpOnly = cookie.HttpOnly,
|
||||
ExpiresUtc = cookie.Expires
|
||||
}));
|
||||
|
||||
var saveResult = await _libraryService.SaveClientAsync(new ClientAccountEntity { Id = client.Id, UserAgent = client.UserAgent }, cancellationToken);
|
||||
var saveResult = await _libraryService.SaveClientAsync(new ClientAccountEntity { Id = client.Id, UserAgent = client.UserAgent, HttpCookies = httpCookies }, cancellationToken);
|
||||
return saveResult;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user