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:
@@ -11,6 +11,7 @@ using ApplicationCore.Interfaces;
|
||||
namespace Microsoft.eShopWeb.Controllers
|
||||
{
|
||||
[Route("[controller]/[action]")]
|
||||
[Authorize]
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private readonly UserManager<ApplicationUser> _userManager;
|
||||
|
||||
@@ -104,7 +104,11 @@ namespace Microsoft.eShopWeb.RazorPages
|
||||
// Add memory cache services
|
||||
services.AddMemoryCache();
|
||||
|
||||
services.AddMvc();
|
||||
services.AddMvc()
|
||||
.AddRazorPagesOptions(options =>
|
||||
{
|
||||
options.Conventions.AuthorizeFolder("/Order");
|
||||
});
|
||||
|
||||
_services = services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user