Browse Source

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
main
Steve Smith 8 years ago
committed by GitHub
parent
commit
16a6f83ef4
  1. 1
      src/Web/Controllers/AccountController.cs
  2. 6
      src/WebRazorPages/Startup.cs

1
src/Web/Controllers/AccountController.cs

@ -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;

6
src/WebRazorPages/Startup.cs

@ -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;
} }

Loading…
Cancel
Save