From eda618034cf433617c14f3464030bb6553ec376f Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 24 Sep 2024 10:47:51 +0200 Subject: [PATCH] Added missing AccessToken to Cookies from login controller --- HopFrame.Api/Controller/SecurityController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/HopFrame.Api/Controller/SecurityController.cs b/HopFrame.Api/Controller/SecurityController.cs index 022db42..fe6ea8e 100644 --- a/HopFrame.Api/Controller/SecurityController.cs +++ b/HopFrame.Api/Controller/SecurityController.cs @@ -45,6 +45,11 @@ public class SecurityController(TDbContext context, IUserService use HttpOnly = true, Secure = true }); + HttpContext.Response.Cookies.Append(ITokenContext.AccessTokenType, accessToken.Token, new CookieOptions { + MaxAge = HopFrameAuthentication.AccessTokenTime, + HttpOnly = true, + Secure = true + }); await context.Tokens.AddRangeAsync(refreshToken, accessToken); await context.SaveChangesAsync();