MvcPrecompilation => Auth 2.0
This commit is contained in:
Родитель
7f4aa60a45
Коммит
d938fef626
|
@ -10,19 +10,14 @@ namespace RazorPagesApp
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
var builder = services.AddMvc();
|
var builder = services.AddMvc();
|
||||||
|
services.AddCookieAuthentication(options => options.LoginPath = "/Login");
|
||||||
ConfigureMvc(builder);
|
ConfigureMvc(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole();
|
loggerFactory.AddConsole();
|
||||||
app.UseCookieAuthentication(new CookieAuthenticationOptions
|
app.UseAuthentication();
|
||||||
{
|
|
||||||
LoginPath = "/Login",
|
|
||||||
AutomaticAuthenticate = true,
|
|
||||||
AutomaticChallenge = true
|
|
||||||
});
|
|
||||||
|
|
||||||
app.UseMvc();
|
app.UseMvc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче