Adding Auth (#62)

* Refactoring ViewModels into Razor Pages models

* Cleaning up Basket viewcomponent

* Refactoring services.
Fixed bug in basket item counter.

* Adding Auth filters to Web and WebWithRazor
This commit is contained in:
Steve Smith
2017-10-23 11:22:54 -04:00
committed by GitHub
parent 16d81ae450
commit 16a6f83ef4
2 changed files with 6 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ using ApplicationCore.Interfaces;
namespace Microsoft.eShopWeb.Controllers namespace Microsoft.eShopWeb.Controllers
{ {
[Route("[controller]/[action]")] [Route("[controller]/[action]")]
[Authorize]
public class AccountController : Controller public class AccountController : Controller
{ {
private readonly UserManager<ApplicationUser> _userManager; private readonly UserManager<ApplicationUser> _userManager;

View File

@@ -104,7 +104,11 @@ namespace Microsoft.eShopWeb.RazorPages
// Add memory cache services // Add memory cache services
services.AddMemoryCache(); services.AddMemoryCache();
services.AddMvc(); services.AddMvc()
.AddRazorPagesOptions(options =>
{
options.Conventions.AuthorizeFolder("/Order");
});
_services = services; _services = services;
} }