Skip to content

Commit bf68ee3

Browse files
committed
fix: Remove unused dependencies
1 parent 0e43313 commit bf68ee3

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/NetDevPack.Identity/JwtBuilderExtensions.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public static IdentityBuilder AddIdentityConfiguration(this IServiceCollection s
3434
{
3535
if (services == null) throw new ArgumentException(nameof(services));
3636
services.UseNetDevPackIdentity();
37-
return services.AddDefaultIdentity<IdentityUser>()
37+
38+
return services.AddIdentityCore<IdentityUser>()
3839
.AddRoles<IdentityRole>()
3940
.AddEntityFrameworkStores<NetDevPackAppDbContext>()
4041
.AddDefaultTokenProviders();
@@ -44,15 +45,17 @@ public static IdentityBuilder AddDefaultIdentity(this IServiceCollection service
4445
{
4546
if (services == null) throw new ArgumentException(nameof(services));
4647
services.UseNetDevPackIdentity<IdentityUser>();
47-
return services.AddDefaultIdentity<IdentityUser>(options);
48+
return services.AddIdentityCore<IdentityUser>(options)
49+
.AddDefaultTokenProviders();
4850
}
4951

5052
public static IdentityBuilder AddCustomIdentity<TIdentityUser>(this IServiceCollection services, Action<IdentityOptions> options = null)
5153
where TIdentityUser : IdentityUser
5254
{
5355
if (services == null) throw new ArgumentException(nameof(services));
5456

55-
return services.AddDefaultIdentity<TIdentityUser>(options);
57+
return services.AddIdentityCore<TIdentityUser>(options)
58+
.AddDefaultTokenProviders();
5659
}
5760

5861
public static IdentityBuilder AddCustomIdentity<TIdentityUser, TKey>(this IServiceCollection services, Action<IdentityOptions> options = null)
@@ -61,7 +64,8 @@ public static IdentityBuilder AddCustomIdentity<TIdentityUser, TKey>(this IServi
6164
{
6265
if (services == null) throw new ArgumentException(nameof(services));
6366
services.UseNetDevPackIdentity<TIdentityUser, TKey>();
64-
return services.AddDefaultIdentity<TIdentityUser>(options);
67+
return services.AddIdentityCore<TIdentityUser>(options)
68+
.AddDefaultTokenProviders();
6569
}
6670

6771
public static IdentityBuilder AddDefaultRoles(this IdentityBuilder builder)

src/NetDevPack.Identity/NetDevPack.Identity.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,16 @@
2323
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
2424
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.24" />
2525
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.15" />
26-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.15" />
27-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.15" />
2826
</ItemGroup>
2927

3028
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
3129
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.16" />
3230
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.6" />
33-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.6" />
34-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.6" />
3531
</ItemGroup>
3632

3733
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
3834
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.4" />
39-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
4035
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.4" />
41-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.4" />
42-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
4336
</ItemGroup>
4437

4538
<Target Name="CopyHook" AfterTargets="AfterBuild" Condition=" '$(Configuration)' == 'Debug' ">
@@ -58,6 +51,7 @@
5851

5952
<ItemGroup>
6053
<PackageReference Include="NetDevPack.Security.Jwt.AspNetCore" Version="6.0.5" />
54+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
6155

6256
</ItemGroup>
6357

0 commit comments

Comments
 (0)