Added missing AccessToken to Cookies from login controller

This commit is contained in:
2024-09-24 10:47:51 +02:00
parent 4aaf126c9d
commit eda618034c

View File

@@ -45,6 +45,11 @@ public class SecurityController<TDbContext>(TDbContext context, IUserService use
HttpOnly = true, HttpOnly = true,
Secure = true Secure = true
}); });
HttpContext.Response.Cookies.Append(ITokenContext.AccessTokenType, accessToken.Token, new CookieOptions {
MaxAge = HopFrameAuthentication<TDbContext>.AccessTokenTime,
HttpOnly = true,
Secure = true
});
await context.Tokens.AddRangeAsync(refreshToken, accessToken); await context.Tokens.AddRangeAsync(refreshToken, accessToken);
await context.SaveChangesAsync(); await context.SaveChangesAsync();