ASP.NET core, change default redirect for unauthorized

With asp.net core 2.0 out now, this has changed to:

services.ConfigureApplicationCookie(options => options.LoginPath = "/Account/LogIn");

More on migrating to 2.0 here. And even more information on migrating from 2.0 to 2.1.

Update for latest Asp.NET 7.0, thanks @Chekkan:

services.AddAuthentication().AddCookie(options => options.LoginPath = "/Login"); 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)