JwtMiddleware berakva

This commit is contained in:
2025-03-14 10:25:24 +01:00
parent 9d0a577c1f
commit 52ac278316
6 changed files with 73 additions and 15 deletions
+6 -1
View File
@@ -2,7 +2,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
using System.Text.Json;
using System.Text.Json.Serialization;
using WorkFlowCheck.API;
using WorkFlowCheck.DL;
using Microsoft.AspNetCore.Mvc;
using Serilog;
@@ -11,6 +10,7 @@ using WorkFlowCheck.BL.Infra;
using WorkFlowCheck.DL.Seed;
using WorkFlowCheck.Common.RequestContext;
using WorkFlowCheck.API.RequestContext;
using WorkFlowCheck.API.Middleware;
var builder = WebApplication.CreateBuilder(args);
@@ -85,6 +85,8 @@ builder.Services.AddCors(options =>
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
@@ -104,7 +106,10 @@ if (app.Environment.IsDevelopment())
// Routing és endpointok
//app.UseHttpsRedirection();
app.UseRouting();
app.UseMiddleware<ApiKeyMiddleware>();
app.UseMiddleware<JwtMiddleware>();
app.MapControllers();
app.UseAuthorization();
app.UseCors();