Skip to content

Commit

Permalink
refactor: rename extensions JsonWebTokenService => JwtService
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Jun 23, 2024
1 parent 59f7b2d commit 6fa2899
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/WeihanLi.Web.Extensions.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
options.KeyLocation = KeyLocation.HeaderOrQuery;
})
;
builder.Services.AddJsonWebTokenServiceWithJwtBearerAuth(options =>
builder.Services.AddJwtServiceWithJwtBearerAuth(options =>
{
options.SecretKey = Guid.NewGuid().ToString();
options.Issuer = "https://id.weihanli.xyz";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace WeihanLi.Web.Authorization.Jwt;

public static class DependencyInjectionExtensions
{
public static IServiceCollection AddJsonWebTokenService(this IServiceCollection serviceCollection, Action<JsonWebTokenOptions> optionsAction)
public static IServiceCollection AddJwtService(this IServiceCollection serviceCollection, Action<JsonWebTokenOptions> optionsAction)
{
Guard.NotNull(serviceCollection);
Guard.NotNull(optionsAction);
Expand All @@ -20,7 +20,7 @@ public static IServiceCollection AddJsonWebTokenService(this IServiceCollection
return serviceCollection;
}

public static IServiceCollection AddJsonWebTokenServiceWithJwtBearerAuth(this IServiceCollection serviceCollection, Action<JsonWebTokenOptions> optionsAction, Action<JwtBearerOptions> jwtBearerOptionsSetup = null)
public static IServiceCollection AddJwtServiceWithJwtBearerAuth(this IServiceCollection serviceCollection, Action<JsonWebTokenOptions> optionsAction, Action<JwtBearerOptions> jwtBearerOptionsSetup = null)
{
Guard.NotNull(serviceCollection);
Guard.NotNull(optionsAction);
Expand All @@ -29,6 +29,6 @@ public static IServiceCollection AddJsonWebTokenServiceWithJwtBearerAuth(this IS
serviceCollection.Configure(jwtBearerOptionsSetup);
}
serviceCollection.ConfigureOptions<JwtBearerOptionsPostSetup>();
return serviceCollection.AddJsonWebTokenService(optionsAction);
return serviceCollection.AddJwtService(optionsAction);
}
}

0 comments on commit 6fa2899

Please sign in to comment.