Finished adding user support and ability to update specific novels or set your last read chapter

This commit is contained in:
2022-07-17 20:34:06 -04:00
parent e4529e11c0
commit b5c4146d4d
34 changed files with 589 additions and 59 deletions

View File

@@ -9,9 +9,11 @@ namespace Treestar.Shared.AccessLayers;
public abstract class ApiAccessLayer
{
private readonly HttpClient _httpClient;
private readonly IAccessLayerAuthenticationProvider _authenticationProvider;
protected ApiAccessLayer(string apiBaseUrl)
protected ApiAccessLayer(string apiBaseUrl, IAccessLayerAuthenticationProvider authenticationProvider)
{
_authenticationProvider = authenticationProvider;
var handler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
@@ -22,6 +24,7 @@ public abstract class ApiAccessLayer
private async Task<HttpResponseWrapper> SendRequest(HttpRequestMessage message)
{
await _authenticationProvider.AddAuthentication(message);
var response = await _httpClient.SendAsync(message);
return new HttpResponseWrapper()
{