重命名了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.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();
app.AddSilkierQuartzAuthentication(); app.UseSilkierQuartzAuthentication() ;
app.UseAuthorization(); app.UseAuthorization();
app.UseSilkierQuartz( app.UseSilkierQuartz(
new SilkierQuartzOptions() 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) 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( services.AddAuthentication(SilkierQuartzAuthenticateConfig.AuthScheme).AddCookie(
SilkierQuartzAuthenticateConfig.AuthScheme, SilkierQuartzAuthenticateConfig.AuthScheme,
cfg => cfg =>
@@ -236,13 +232,12 @@ namespace SilkierQuartz
/// </summary> /// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <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> /// <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) if (app == null)
{ {
throw new ArgumentNullException(nameof(app)); throw new ArgumentNullException(nameof(app));
} }
return app.UseMiddleware<SilkierQuartzAuthenticationMiddleware>(); return app.UseMiddleware<SilkierQuartzAuthenticationMiddleware>();
} }
} }