mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-20 15:41:40 -04:00
Add client to auth logs in api and wasm client (#541)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
using AliasVault.Client;
|
||||
using AliasVault.Client.Providers;
|
||||
using AliasVault.RazorComponents.Services;
|
||||
using AliasVault.Shared.Core;
|
||||
using Blazored.LocalStorage;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
@@ -56,6 +57,10 @@ builder.Services.AddScoped(sp =>
|
||||
// If API URL override is set (used e.g. in dev), then ensure the API URL ends with a forward slash.
|
||||
var baseUrl = string.IsNullOrEmpty(apiConfig.ApiUrl) ? builder.HostEnvironment.BaseAddress + "api/" : apiConfig.ApiUrl.TrimEnd('/') + "/";
|
||||
httpClient.BaseAddress = new Uri(baseUrl);
|
||||
|
||||
// Add client header.
|
||||
httpClient.DefaultRequestHeaders.Add("X-AliasVault-Client", "client-" + AppInfo.GetFullVersion());
|
||||
|
||||
return httpClient;
|
||||
});
|
||||
builder.Services.AddTransient<AliasVaultApiHandlerService>();
|
||||
|
||||
Reference in New Issue
Block a user