Refactor to use IHttpClientFactory and remove ApiOptions
Replaced direct injection of HttpClient with IHttpClientFactory across the codebase to improve HTTP client management and align with best practices. Removed dependency on ApiOptions and IOptions<ApiOptions> in multiple services, simplifying constructors and reducing configuration complexity. Updated FontLoader to use IHttpClientFactory for font loading with relative paths. Adjusted comments and documentation to reflect these changes. Cleaned up unused using directives related to ApiOptions.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using EnvelopeGenerator.Server.Client.Options;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace EnvelopeGenerator.Server.Client.Services;
|
||||
|
||||
@@ -10,9 +8,8 @@ public enum EnvelopeLoginResult { Success, InvalidCode, NotFound, Error }
|
||||
|
||||
public enum SenderLoginResult { Success, InvalidCredentials, Error }
|
||||
|
||||
public class AuthService(IHttpClientFactory httpClientFactory, IOptions<ApiOptions> apiOptions)
|
||||
public class AuthService(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
private readonly ApiOptions _api = apiOptions.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the current user holds a valid receiver token for the given envelope key.
|
||||
|
||||
Reference in New Issue
Block a user