feat: implement Turnstile verification for enhanced security during login and registration

refactor: remove unnecessary interfaces for services; change user key from UID to UUID
This commit is contained in:
2025-12-31 12:11:09 -05:00
parent 08c4be4f7e
commit 848b8598e5
27 changed files with 579 additions and 84 deletions
@@ -57,9 +57,6 @@ namespace SharpbinV3.Server.Migrations
b.Property<Guid>("UUID")
.HasColumnType("TEXT");
b.Property<int?>("UserUID")
.HasColumnType("INTEGER");
b.Property<int>("Views")
.HasColumnType("INTEGER");
@@ -81,8 +78,6 @@ namespace SharpbinV3.Server.Migrations
b.HasIndex("UUID")
.IsUnique();
b.HasIndex("UserUID");
b.HasIndex("Views");
b.HasIndex("Visibility");
@@ -93,7 +88,6 @@ namespace SharpbinV3.Server.Migrations
modelBuilder.Entity("SharpbinV3.Server.Data.Entities.RefreshToken", b =>
{
b.Property<Guid>("UserUUID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<long>("CreatedAt")
@@ -113,21 +107,16 @@ namespace SharpbinV3.Server.Migrations
b.Property<bool>("Used")
.HasColumnType("INTEGER");
b.Property<int?>("UserUID")
.HasColumnType("INTEGER");
b.HasKey("UserUUID");
b.HasIndex("UserUID");
b.ToTable("RefreshTokens");
});
modelBuilder.Entity("SharpbinV3.Server.Data.Entities.User", b =>
{
b.Property<int>("UID")
b.Property<Guid>("UUID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
@@ -146,8 +135,8 @@ namespace SharpbinV3.Server.Migrations
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("UUID")
.HasColumnType("TEXT");
b.Property<int>("UID")
.HasColumnType("INTEGER");
b.Property<string>("Username")
.IsRequired()
@@ -156,7 +145,7 @@ namespace SharpbinV3.Server.Migrations
b.Property<int>("Visibility")
.HasColumnType("INTEGER");
b.HasKey("UID");
b.HasKey("UUID");
b.HasIndex("UUID")
.IsUnique();
@@ -168,7 +157,9 @@ namespace SharpbinV3.Server.Migrations
{
b.HasOne("SharpbinV3.Server.Data.Entities.User", "User")
.WithMany("Pastes")
.HasForeignKey("UserUID");
.HasForeignKey("AuthorUUID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
@@ -176,8 +167,10 @@ namespace SharpbinV3.Server.Migrations
modelBuilder.Entity("SharpbinV3.Server.Data.Entities.RefreshToken", b =>
{
b.HasOne("SharpbinV3.Server.Data.Entities.User", "User")
.WithMany()
.HasForeignKey("UserUID");
.WithMany("RefreshTokens")
.HasForeignKey("UserUUID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
@@ -185,6 +178,8 @@ namespace SharpbinV3.Server.Migrations
modelBuilder.Entity("SharpbinV3.Server.Data.Entities.User", b =>
{
b.Navigation("Pastes");
b.Navigation("RefreshTokens");
});
#pragma warning restore 612, 618
}