Skip to content

Commit

Permalink
Adding Auth (dotnet-architecture#62)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ardalis authored Oct 23, 2017
1 parent 16d81ae commit 16a6f83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Web/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Microsoft.eShopWeb.Controllers
{
[Route("[controller]/[action]")]
[Authorize]
public class AccountController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
Expand Down
6 changes: 5 additions & 1 deletion src/WebRazorPages/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ public void ConfigureServices(IServiceCollection services)
// Add memory cache services
services.AddMemoryCache();

services.AddMvc();
services.AddMvc()
.AddRazorPagesOptions(options =>
{
options.Conventions.AuthorizeFolder("/Order");
});

_services = services;
}
Expand Down

0 comments on commit 16a6f83

Please sign in to comment.