重命名了UseSilkierQuartzAuthentication

This commit is contained in:
MysticBoy
2021-03-11 12:37:05 +08:00
parent ab43cce2f9
commit 32dd499e6b
2 changed files with 2 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ namespace SilkierQuartz.Example
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.AddSilkierQuartzAuthentication();
app.UseSilkierQuartzAuthentication() ;
app.UseAuthorization();
app.UseSilkierQuartz(
new SilkierQuartzOptions()

View File

@@ -167,10 +167,6 @@ namespace SilkierQuartz
public static IServiceCollection AddSilkierQuartz(this IServiceCollection services, Action<NameValueCollection> stdSchedulerFactoryOptions = null, Func<List<Assembly>> jobsasmlist = null)
{
services.AddControllers()
.AddApplicationPart(Assembly.GetExecutingAssembly())
.AddNewtonsoftJson();
services.AddAuthentication(SilkierQuartzAuthenticateConfig.AuthScheme).AddCookie(
SilkierQuartzAuthenticateConfig.AuthScheme,
cfg =>
@@ -236,13 +232,12 @@ namespace SilkierQuartz
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IApplicationBuilder AddSilkierQuartzAuthentication(this IApplicationBuilder app)
public static IApplicationBuilder UseSilkierQuartzAuthentication(this IApplicationBuilder app)
{
if (app == null)
{
throw new ArgumentNullException(nameof(app));
}
return app.UseMiddleware<SilkierQuartzAuthenticationMiddleware>();
}
}