Got RedirectToLoginIfNotAuth test working

This commit is contained in:
Steve Smith
2019-02-22 14:21:14 -05:00
parent f5a17ec635
commit 765e1508bf
3 changed files with 80 additions and 2 deletions

View File

@@ -166,6 +166,7 @@ namespace Microsoft.eShopWeb.Web
{
options.Cookie.HttpOnly = true;
options.ExpireTimeSpan = TimeSpan.FromHours(1);
options.LoginPath = "/Account/Login";
options.LogoutPath = "/Account/Signout";
options.Cookie = new CookieBuilder
{
@@ -228,6 +229,10 @@ namespace Microsoft.eShopWeb.Web
app.UseMvc(routes =>
{
routes.MapRoute(
name: "identity",
template: "Identity/{controller=Account}/{action=Register}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller:slugify=Home}/{action:slugify=Index}/{id?}");