JwtMiddleware berakva
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user