Cleaned up using in project. Improved prohect structure and refactored page names. Upgraded dependencies
This commit is contained in:
@@ -12,10 +12,11 @@ namespace Moonlight.Api.Admin.Users.Users;
|
||||
|
||||
public class UserAuthService
|
||||
{
|
||||
public const string CacheKeyPattern = $"Moonlight.{nameof(UserAuthService)}.{nameof(ValidateAsync)}-{{0}}";
|
||||
|
||||
private const string UserIdClaim = "UserId";
|
||||
private const string IssuedAtClaim = "IssuedAt";
|
||||
|
||||
public const string CacheKeyPattern = $"Moonlight.{nameof(UserAuthService)}.{nameof(ValidateAsync)}-{{0}}";
|
||||
|
||||
private readonly IEnumerable<IUserAuthHook> Hooks;
|
||||
private readonly HybridCache HybridCache;
|
||||
private readonly ILogger<UserAuthService> Logger;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class UserDeletionController : Controller
|
||||
var validationResult = await UserDeletionService.ValidateAsync(id);
|
||||
|
||||
if (!validationResult.IsValid)
|
||||
{
|
||||
return ValidationProblem(
|
||||
new ValidationProblemDetails(
|
||||
new Dictionary<string, string[]>
|
||||
@@ -45,6 +46,7 @@ public class UserDeletionController : Controller
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
await UserDeletionService.DeleteAsync(id);
|
||||
return NoContent();
|
||||
|
||||
@@ -43,7 +43,9 @@ public class UsersController : Controller
|
||||
|
||||
// Filters
|
||||
if (filterOptions != null)
|
||||
{
|
||||
foreach (var filterOption in filterOptions.Filters)
|
||||
{
|
||||
query = filterOption.Key switch
|
||||
{
|
||||
nameof(Infrastructure.Database.Entities.User.Email) =>
|
||||
@@ -54,6 +56,8 @@ public class UsersController : Controller
|
||||
|
||||
_ => query
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Pagination
|
||||
var data = await query
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DbMigrationService : IHostedLifecycleService
|
||||
|
||||
if (migrationNames.Length == 0)
|
||||
{
|
||||
Logger.LogDebug("No pending migrations found");
|
||||
Logger.LogTrace("No pending migrations found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.3"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.3"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.3"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.3.0"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.3"/>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0"/>
|
||||
<PackageReference Include="Riok.Mapperly" Version="4.3.1"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.4.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.5" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||
<PackageReference Include="Riok.Mapperly" Version="5.0.0-next.2" />
|
||||
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2"/>
|
||||
<PackageReference Include="VYaml" Version="1.2.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -15,7 +15,7 @@ using Moonlight.Api.Infrastructure.Helpers;
|
||||
using Moonlight.Api.Infrastructure.Hooks;
|
||||
using Moonlight.Api.Infrastructure.Implementations;
|
||||
using Moonlight.Api.Shared.Frontend;
|
||||
using SerializationContext = Moonlight.Shared.SerializationContext;
|
||||
using Moonlight.Shared;
|
||||
using VersionService = Moonlight.Api.Admin.Sys.Versions.VersionService;
|
||||
|
||||
namespace Moonlight.Api.Startup;
|
||||
|
||||
Reference in New Issue
Block a user