From eb272baa385f6d6536f18c514ccc0ebb0400dbb4 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Thu, 31 Oct 2024 04:23:43 +0300 Subject: [PATCH] fix: change cookie name --- .../Core/Middleware/CookieAuthorizationMiddleware.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Endpoint/Configuration/Core/Middleware/CookieAuthorizationMiddleware.cs b/Endpoint/Configuration/Core/Middleware/CookieAuthorizationMiddleware.cs index 1b97741..1faad1a 100644 --- a/Endpoint/Configuration/Core/Middleware/CookieAuthorizationMiddleware.cs +++ b/Endpoint/Configuration/Core/Middleware/CookieAuthorizationMiddleware.cs @@ -1,15 +1,15 @@ using Microsoft.AspNetCore.Http; +using Mirea.Api.Security.Common; using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Configuration.Core.Middleware; public class CookieAuthorizationMiddleware(RequestDelegate next) { - public const string JwtAuthorizationName = "_ajwt"; public async Task InvokeAsync(HttpContext context) { - if (context.Request.Cookies.ContainsKey(JwtAuthorizationName)) - context.Request.Headers.Authorization = "Bearer " + context.Request.Cookies[JwtAuthorizationName]; + if (context.Request.Cookies.ContainsKey(CookieNames.AccessToken)) + context.Request.Headers.Authorization = "Bearer " + context.Request.Cookies[CookieNames.AccessToken]; await next(context); }