Created
May 7, 2019 09:21
-
-
Save mikebrind/ff9bc90873efabfd3bc93f7923e0d2f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.Configure<CookiePolicyOptions>(options => | |
{ | |
// This lambda determines whether user consent for non-essential cookies is needed for a given request. | |
options.CheckConsentNeeded = context => true; | |
options.MinimumSameSitePolicy = SameSiteMode.None; | |
}); | |
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(cookieOptions => { | |
cookieOptions.LoginPath = "/"; | |
}); | |
services.AddMvc().AddRazorPagesOptions(options => { | |
options.Conventions.AuthorizeFolder("/admin"); | |
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment