fix: update package versions for EntityFramework and adjust API endpoint in login component

This commit is contained in:
Marek Lesko
2025-07-30 08:05:36 +02:00
parent 329fb94a3a
commit af127b716e
4 changed files with 9 additions and 10 deletions

View File

@@ -12,11 +12,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.18" NoWarn="NU1605" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.18" NoWarn="NU1605" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.18">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.18" />
<PackageReference Include="Microsoft.Identity.Web" Version="3.10.0" />
<PackageReference Include="Microsoft.Identity.Web.DownstreamApi" Version="3.10.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />

View File

@@ -6,8 +6,8 @@ using Microsoft.AspNetCore.Authorization;
namespace Api.Controllers
{
[ApiController]
[Authorize]
[Route("api/[controller]")]
//[Authorize]
[Route("api/product")]
public class ProductController : ControllerBase
{
private readonly AppDbContext _context;
@@ -19,7 +19,6 @@ namespace Api.Controllers
// GET: api/Product
[HttpGet]
[Route("api/product")]
public async Task<ActionResult<IEnumerable<Product>>> GetProducts([FromQuery] int? id = null)
{
if (id.HasValue)

View File

@@ -31,8 +31,8 @@ namespace Api
options.Authority = builder.Configuration["Authentication:PocketId:Authority"];
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters()
{
ValidAudiences = builder.Configuration["Authentication:PocketId:ClientId"].Split(';').Select(i => i.Trim()).ToArray(),
ValidIssuers = builder.Configuration["Authentication:PocketId:Authority"].Split(';').Select(i => i.Trim()).ToArray()
ValidAudiences = builder.Configuration["Authentication:PocketId:ClientId"]?.Split(';').Select(i => i.Trim()).ToArray(),
ValidIssuers = builder.Configuration["Authentication:PocketId:Authority"]?.Split(';').Select(i => i.Trim()).ToArray()
};
});