Skip to content

Commit 7b307fe

Browse files
Merge pull request #26 from NetDevPack/feat/net7
fix: sample
2 parents 726a385 + 297960f commit 7b307fe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Samples/AspNetCore.Jwt.Sample/Config/CustomIdentityAndKeyConfig.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public static void AddCustomIdentityAndKeyConfiguration(this IServiceCollection
1717
services.AddDbContext<MyIntIdentityContext>(options => options.UseInMemoryDatabase("NetDevPack.Identity"));
1818

1919
// Your own Identity configuration
20-
services.AddCustomIdentity<MyIntIdentityUser, int>(options =>
20+
services.AddIdentityCore<MyIntIdentityUser>(options =>
2121
{
2222
options.SignIn.RequireConfirmedEmail = false;
2323
options.Lockout.MaxFailedAccessAttempts = 5;
2424
})
25-
.AddCustomRoles<MyIntIdentityRoles, int>()
26-
.AddCustomEntityFrameworkStores<MyIntIdentityContext>()
25+
.AddRoles<MyIntIdentityRoles>()
26+
.AddEntityFrameworkStores<MyIntIdentityContext>()
2727
.AddDefaultTokenProviders();
2828

2929
// Ours JWT configuration

src/Samples/AspNetCore.Jwt.Sample/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
//builder.Services.AddCustomIdentityConfiguration(builder.Configuration);
1616

1717
// When you have specifics configurations (with Key type [see inside this method])
18-
builder.Services.AddCustomIdentityAndKeyConfiguration(builder.Configuration);
18+
19+
builder.Services.AddMemoryCache()
20+
.AddCustomIdentityAndKeyConfiguration(builder.Configuration);
1921

2022
// Setting the interactive AspNetUser (logged in)
2123
builder.Services.AddAspNetUserConfiguration();

0 commit comments

Comments
 (0)