asp.net 5 mvc 6 loginUrl change path

后端 未结 4 1040
死守一世寂寞
死守一世寂寞 2021-01-17 15:20

When creating a new project in VS 2015 WebApplication, how would you go about changing the Redirect LoginUrl Path when not Authorize\'d?

I have created a new Area, w

4条回答
  •  梦毁少年i
    2021-01-17 15:38

    Try doing the following:

    services.Configure(options =>
    {
        options.LoginPath = new PathString("//Account/Login");
    });
    

    Question: Did you decorate your controller with an [Area] attribute?

提交回复
热议问题