Skip to content

Commit e65b6bf

Browse files
authored
Final Preview Review (#31)
* Final Preview Review * Minor Polish * Added Multi Profile Support * Fix Test * Fix Warnings & Added Refresh Integration Tests * Final Cleanup * PasswordHash Enhancement * Added Some XML Comments
1 parent 3db4d38 commit e65b6bf

197 files changed

Lines changed: 2691 additions & 801 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/CodeBeam.UltimateAuth.Sample.Seed/UserSeedContributor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ await lifecycleStore.AddAsync(
5959
ct);
6060
}
6161

62-
var profileKey = new UserProfileKey(tenant, userKey);
62+
var profileKey = new UserProfileKey(tenant, userKey, ProfileKey.Default);
6363
if (!await profileStore.ExistsAsync(profileKey, ct))
6464
{
6565
await profileStore.AddAsync(
66-
UserProfile.Create(Guid.NewGuid(), tenant, userKey, now, displayName: displayName),
66+
UserProfile.Create(Guid.NewGuid(), tenant, userKey, ProfileKey.Default, now, displayName: displayName),
6767
ct);
6868
}
6969

samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
o.Login.MaxFailedAttempts = 2;
3939
o.Login.LockoutDuration = TimeSpan.FromSeconds(10);
4040
o.Identifiers.AllowMultipleUsernames = true;
41+
o.UserProfile.EnableMultiProfile = true;
4142
})
4243
.AddUltimateAuthInMemory()
4344
.AddUAuthHub(o => o.AllowedClientOrigins.Add("https://localhost:6130")); // Client sample's URL

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Dialogs/UsersDialog.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Are you sure you want to delete <b>{user.DisplayName ?? user.UserName ?? user.Pr
144144
Mode = DeleteMode.Soft
145145
};
146146

147-
var result = await UAuthClient.Users.DeleteUserAsync(UserKey.Parse(user.UserKey, null), req);
147+
var result = await UAuthClient.Users.DeleteUserAsync(user.UserKey, req);
148148

149149
if (result.IsSuccess)
150150
{

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Migrations/20260327184128_InitUltimateAuth.Designer.cs renamed to samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Migrations/20260406192328_InitUltimateAuth.Designer.cs

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Migrations/20260327184128_InitUltimateAuth.cs renamed to samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Migrations/20260406192328_InitUltimateAuth.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
182182
Id = table.Column<Guid>(type: "TEXT", nullable: false),
183183
Tenant = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
184184
UserKey = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
185+
ProfileKey = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
185186
FirstName = table.Column<string>(type: "TEXT", nullable: true),
186187
LastName = table.Column<string>(type: "TEXT", nullable: true),
187188
DisplayName = table.Column<string>(type: "TEXT", nullable: true),
@@ -498,9 +499,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
498499
unique: true);
499500

500501
migrationBuilder.CreateIndex(
501-
name: "IX_UAuth_UserProfiles_Tenant_UserKey",
502+
name: "IX_UAuth_UserProfiles_Tenant_UserKey_ProfileKey",
502503
table: "UAuth_UserProfiles",
503-
columns: new[] { "Tenant", "UserKey" });
504+
columns: new[] { "Tenant", "UserKey", "ProfileKey" },
505+
unique: true);
504506

505507
migrationBuilder.CreateIndex(
506508
name: "IX_UAuth_UserRoles_Tenant_RoleId",

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Migrations/UAuthDbContextModelSnapshot.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
655655
b.Property<string>("Metadata")
656656
.HasColumnType("TEXT");
657657

658+
b.Property<string>("ProfileKey")
659+
.IsRequired()
660+
.HasMaxLength(64)
661+
.HasColumnType("TEXT");
662+
658663
b.Property<string>("Tenant")
659664
.IsRequired()
660665
.HasMaxLength(128)
@@ -677,7 +682,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
677682

678683
b.HasKey("Id");
679684

680-
b.HasIndex("Tenant", "UserKey");
685+
b.HasIndex("Tenant", "UserKey", "ProfileKey")
686+
.IsUnique();
681687

682688
b.ToTable("UAuth_UserProfiles", (string)null);
683689
});
Binary file not shown.
Binary file not shown.
Binary file not shown.

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Dialogs/UsersDialog.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Are you sure you want to delete <b>{user.DisplayName ?? user.UserName ?? user.Pr
144144
Mode = DeleteMode.Soft
145145
};
146146

147-
var result = await UAuthClient.Users.DeleteUserAsync(UserKey.Parse(user.UserKey, null), req);
147+
var result = await UAuthClient.Users.DeleteUserAsync(user.UserKey, req);
148148

149149
if (result.IsSuccess)
150150
{

0 commit comments

Comments
 (0)