Skip to content

Commit

Permalink
fix: sample
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobritodev committed Nov 17, 2022
1 parent 062deca commit 297960f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public static void AddCustomIdentityAndKeyConfiguration(this IServiceCollection
services.AddDbContext<MyIntIdentityContext>(options => options.UseInMemoryDatabase("NetDevPack.Identity"));

// Your own Identity configuration
services.AddCustomIdentity<MyIntIdentityUser, int>(options =>
services.AddIdentityCore<MyIntIdentityUser>(options =>
{
options.SignIn.RequireConfirmedEmail = false;
options.Lockout.MaxFailedAccessAttempts = 5;
})
.AddCustomRoles<MyIntIdentityRoles, int>()
.AddCustomEntityFrameworkStores<MyIntIdentityContext>()
.AddRoles<MyIntIdentityRoles>()
.AddEntityFrameworkStores<MyIntIdentityContext>()
.AddDefaultTokenProviders();

// Ours JWT configuration
Expand Down
4 changes: 3 additions & 1 deletion src/Samples/AspNetCore.Jwt.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
//builder.Services.AddCustomIdentityConfiguration(builder.Configuration);

// When you have specifics configurations (with Key type [see inside this method])
builder.Services.AddCustomIdentityAndKeyConfiguration(builder.Configuration);

builder.Services.AddMemoryCache()
.AddCustomIdentityAndKeyConfiguration(builder.Configuration);

// Setting the interactive AspNetUser (logged in)
builder.Services.AddAspNetUserConfiguration();
Expand Down

0 comments on commit 297960f

Please sign in to comment.