public async Task <IActionResult> OnPostAddToCartAsync(int productId) { if (!User.Identity.IsAuthenticated) { return(RedirectToPage("./Account/Login", new { area = "Identity" })); } await _productPageService.AddToCart(User.Identity.Name, productId); return(RedirectToPage()); }